annotate Resources/Orthanc/Sdk-1.5.0/orthanc/OrthancCPlugin.h @ 78:0898578d5708 OrthancTransfers-1.3 tip

closing OrthancTransfers-1.3
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 30 May 2024 22:45:33 +0200
parents 1256194e1c08
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
40
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2 * \mainpage
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4 * This C/C++ SDK allows external developers to create plugins that
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5 * can be loaded into Orthanc to extend its functionality. Each
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6 * Orthanc plugin must expose 4 public functions with the following
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
7 * signatures:
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
8 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
9 * -# <tt>int32_t OrthancPluginInitialize(const OrthancPluginContext* context)</tt>:
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
10 * This function is invoked by Orthanc when it loads the plugin on startup.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
11 * The plugin must:
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
12 * - Check its compatibility with the Orthanc version using
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
13 * ::OrthancPluginCheckVersion().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
14 * - Store the context pointer so that it can use the plugin
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
15 * services of Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
16 * - Register all its REST callbacks using ::OrthancPluginRegisterRestCallback().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
17 * - Possibly register its callback for received DICOM instances using ::OrthancPluginRegisterOnStoredInstanceCallback().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
18 * - Possibly register its callback for changes to the DICOM store using ::OrthancPluginRegisterOnChangeCallback().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
19 * - Possibly register a custom storage area using ::OrthancPluginRegisterStorageArea().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
20 * - Possibly register a custom database back-end area using OrthancPluginRegisterDatabaseBackendV2().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
21 * - Possibly register a handler for C-Find SCP using OrthancPluginRegisterFindCallback().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
22 * - Possibly register a handler for C-Find SCP against DICOM worklists using OrthancPluginRegisterWorklistCallback().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
23 * - Possibly register a handler for C-Move SCP using OrthancPluginRegisterMoveCallback().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
24 * - Possibly register a custom decoder for DICOM images using OrthancPluginRegisterDecodeImageCallback().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
25 * - Possibly register a callback to filter incoming HTTP requests using OrthancPluginRegisterIncomingHttpRequestFilter2().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
26 * - Possibly register a callback to unserialize jobs using OrthancPluginRegisterJobsUnserializer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
27 * -# <tt>void OrthancPluginFinalize()</tt>:
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
28 * This function is invoked by Orthanc during its shutdown. The plugin
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
29 * must free all its memory.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
30 * -# <tt>const char* OrthancPluginGetName()</tt>:
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
31 * The plugin must return a short string to identify itself.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
32 * -# <tt>const char* OrthancPluginGetVersion()</tt>:
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
33 * The plugin must return a string containing its version number.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
34 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
35 * The name and the version of a plugin is only used to prevent it
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
36 * from being loaded twice. Note that, in C++, it is mandatory to
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
37 * declare these functions within an <tt>extern "C"</tt> section.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
38 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
39 * To ensure multi-threading safety, the various REST callbacks are
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
40 * guaranteed to be executed in mutual exclusion since Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
41 * 0.8.5. If this feature is undesired (notably when developing
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
42 * high-performance plugins handling simultaneous requests), use
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
43 * ::OrthancPluginRegisterRestCallbackNoLock().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
44 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
45
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
46
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
47
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
48 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
49 * @defgroup Images Images and compression
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
50 * @brief Functions to deal with images and compressed buffers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
51 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
52 * @defgroup REST REST
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
53 * @brief Functions to answer REST requests in a callback.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
54 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
55 * @defgroup Callbacks Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
56 * @brief Functions to register and manage callbacks by the plugins.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
57 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
58 * @defgroup DicomCallbacks DicomCallbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
59 * @brief Functions to register and manage DICOM callbacks (worklists, C-Find, C-MOVE).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
60 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
61 * @defgroup Orthanc Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
62 * @brief Functions to access the content of the Orthanc server.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
63 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
64
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
65
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
66
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
67 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
68 * @defgroup Toolbox Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
69 * @brief Generic functions to help with the creation of plugins.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
70 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
71
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
72
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
73
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
74 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
75 * Orthanc - A Lightweight, RESTful DICOM Store
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
76 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
77 * Department, University Hospital of Liege, Belgium
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
78 * Copyright (C) 2017-2018 Osimis S.A., Belgium
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
79 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
80 * This program is free software: you can redistribute it and/or
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
81 * modify it under the terms of the GNU General Public License as
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
82 * published by the Free Software Foundation, either version 3 of the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
83 * License, or (at your option) any later version.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
84 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
85 * In addition, as a special exception, the copyright holders of this
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
86 * program give permission to link the code of its release with the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
87 * OpenSSL project's "OpenSSL" library (or with modified versions of it
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
88 * that use the same license as the "OpenSSL" library), and distribute
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
89 * the linked executables. You must obey the GNU General Public License
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
90 * in all respects for all of the code used other than "OpenSSL". If you
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
91 * modify file(s) with this exception, you may extend this exception to
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
92 * your version of the file(s), but you are not obligated to do so. If
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
93 * you do not wish to do so, delete this exception statement from your
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
94 * version. If you delete this exception statement from all source files
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
95 * in the program, then also delete it here.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
96 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
97 * This program is distributed in the hope that it will be useful, but
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
98 * WITHOUT ANY WARRANTY; without even the implied warranty of
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
99 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
100 * General Public License for more details.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
101 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
102 * You should have received a copy of the GNU General Public License
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
103 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
104 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
105
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
106
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
107
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
108 #pragma once
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
109
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
110
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
111 #include <stdio.h>
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
112 #include <string.h>
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
113
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
114 #ifdef WIN32
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
115 #define ORTHANC_PLUGINS_API __declspec(dllexport)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
116 #else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
117 #define ORTHANC_PLUGINS_API
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
118 #endif
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
119
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
120 #define ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER 1
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
121 #define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER 5
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
122 #define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 0
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
123
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
124
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
125 #if !defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
126 #define ORTHANC_PLUGINS_VERSION_IS_ABOVE(major, minor, revision) \
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
127 (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER > major || \
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
128 (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER == major && \
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
129 (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER > minor || \
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
130 (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER == minor && \
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
131 ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER >= revision))))
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
132 #endif
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
133
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
134
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
135
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
136 /********************************************************************
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
137 ** Check that function inlining is properly supported. The use of
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
138 ** inlining is required, to avoid the duplication of object code
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
139 ** between two compilation modules that would use the Orthanc Plugin
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
140 ** API.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
141 ********************************************************************/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
142
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
143 /* If the auto-detection of the "inline" keyword below does not work
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
144 automatically and that your compiler is known to properly support
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
145 inlining, uncomment the following #define and adapt the definition
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
146 of "static inline". */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
147
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
148 /* #define ORTHANC_PLUGIN_INLINE static inline */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
149
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
150 #ifndef ORTHANC_PLUGIN_INLINE
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
151 # if __STDC_VERSION__ >= 199901L
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
152 /* This is C99 or above: http://predef.sourceforge.net/prestd.html */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
153 # define ORTHANC_PLUGIN_INLINE static inline
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
154 # elif defined(__cplusplus)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
155 /* This is C++ */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
156 # define ORTHANC_PLUGIN_INLINE static inline
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
157 # elif defined(__GNUC__)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
158 /* This is GCC running in C89 mode */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
159 # define ORTHANC_PLUGIN_INLINE static __inline
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
160 # elif defined(_MSC_VER)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
161 /* This is Visual Studio running in C89 mode */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
162 # define ORTHANC_PLUGIN_INLINE static __inline
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
163 # else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
164 # error Your compiler is not known to support the "inline" keyword
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
165 # endif
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
166 #endif
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
167
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
168
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
169
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
170 /********************************************************************
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
171 ** Inclusion of standard libraries.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
172 ********************************************************************/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
173
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
174 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
175 * For Microsoft Visual Studio, a compatibility "stdint.h" can be
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
176 * downloaded at the following URL:
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
177 * https://orthanc.googlecode.com/hg/Resources/ThirdParty/VisualStudio/stdint.h
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
178 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
179 #include <stdint.h>
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
180
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
181 #include <stdlib.h>
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
182
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
183
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
184
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
185 /********************************************************************
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
186 ** Definition of the Orthanc Plugin API.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
187 ********************************************************************/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
188
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
189 /** @{ */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
190
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
191 #ifdef __cplusplus
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
192 extern "C"
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
193 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
194 #endif
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
195
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
196 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
197 * The various error codes that can be returned by the Orthanc core.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
198 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
199 typedef enum
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
200 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
201 OrthancPluginErrorCode_InternalError = -1 /*!< Internal error */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
202 OrthancPluginErrorCode_Success = 0 /*!< Success */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
203 OrthancPluginErrorCode_Plugin = 1 /*!< Error encountered within the plugin engine */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
204 OrthancPluginErrorCode_NotImplemented = 2 /*!< Not implemented yet */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
205 OrthancPluginErrorCode_ParameterOutOfRange = 3 /*!< Parameter out of range */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
206 OrthancPluginErrorCode_NotEnoughMemory = 4 /*!< The server hosting Orthanc is running out of memory */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
207 OrthancPluginErrorCode_BadParameterType = 5 /*!< Bad type for a parameter */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
208 OrthancPluginErrorCode_BadSequenceOfCalls = 6 /*!< Bad sequence of calls */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
209 OrthancPluginErrorCode_InexistentItem = 7 /*!< Accessing an inexistent item */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
210 OrthancPluginErrorCode_BadRequest = 8 /*!< Bad request */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
211 OrthancPluginErrorCode_NetworkProtocol = 9 /*!< Error in the network protocol */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
212 OrthancPluginErrorCode_SystemCommand = 10 /*!< Error while calling a system command */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
213 OrthancPluginErrorCode_Database = 11 /*!< Error with the database engine */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
214 OrthancPluginErrorCode_UriSyntax = 12 /*!< Badly formatted URI */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
215 OrthancPluginErrorCode_InexistentFile = 13 /*!< Inexistent file */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
216 OrthancPluginErrorCode_CannotWriteFile = 14 /*!< Cannot write to file */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
217 OrthancPluginErrorCode_BadFileFormat = 15 /*!< Bad file format */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
218 OrthancPluginErrorCode_Timeout = 16 /*!< Timeout */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
219 OrthancPluginErrorCode_UnknownResource = 17 /*!< Unknown resource */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
220 OrthancPluginErrorCode_IncompatibleDatabaseVersion = 18 /*!< Incompatible version of the database */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
221 OrthancPluginErrorCode_FullStorage = 19 /*!< The file storage is full */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
222 OrthancPluginErrorCode_CorruptedFile = 20 /*!< Corrupted file (e.g. inconsistent MD5 hash) */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
223 OrthancPluginErrorCode_InexistentTag = 21 /*!< Inexistent tag */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
224 OrthancPluginErrorCode_ReadOnly = 22 /*!< Cannot modify a read-only data structure */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
225 OrthancPluginErrorCode_IncompatibleImageFormat = 23 /*!< Incompatible format of the images */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
226 OrthancPluginErrorCode_IncompatibleImageSize = 24 /*!< Incompatible size of the images */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
227 OrthancPluginErrorCode_SharedLibrary = 25 /*!< Error while using a shared library (plugin) */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
228 OrthancPluginErrorCode_UnknownPluginService = 26 /*!< Plugin invoking an unknown service */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
229 OrthancPluginErrorCode_UnknownDicomTag = 27 /*!< Unknown DICOM tag */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
230 OrthancPluginErrorCode_BadJson = 28 /*!< Cannot parse a JSON document */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
231 OrthancPluginErrorCode_Unauthorized = 29 /*!< Bad credentials were provided to an HTTP request */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
232 OrthancPluginErrorCode_BadFont = 30 /*!< Badly formatted font file */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
233 OrthancPluginErrorCode_DatabasePlugin = 31 /*!< The plugin implementing a custom database back-end does not fulfill the proper interface */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
234 OrthancPluginErrorCode_StorageAreaPlugin = 32 /*!< Error in the plugin implementing a custom storage area */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
235 OrthancPluginErrorCode_EmptyRequest = 33 /*!< The request is empty */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
236 OrthancPluginErrorCode_NotAcceptable = 34 /*!< Cannot send a response which is acceptable according to the Accept HTTP header */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
237 OrthancPluginErrorCode_NullPointer = 35 /*!< Cannot handle a NULL pointer */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
238 OrthancPluginErrorCode_DatabaseUnavailable = 36 /*!< The database is currently not available (probably a transient situation) */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
239 OrthancPluginErrorCode_CanceledJob = 37 /*!< This job was canceled */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
240 OrthancPluginErrorCode_SQLiteNotOpened = 1000 /*!< SQLite: The database is not opened */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
241 OrthancPluginErrorCode_SQLiteAlreadyOpened = 1001 /*!< SQLite: Connection is already open */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
242 OrthancPluginErrorCode_SQLiteCannotOpen = 1002 /*!< SQLite: Unable to open the database */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
243 OrthancPluginErrorCode_SQLiteStatementAlreadyUsed = 1003 /*!< SQLite: This cached statement is already being referred to */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
244 OrthancPluginErrorCode_SQLiteExecute = 1004 /*!< SQLite: Cannot execute a command */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
245 OrthancPluginErrorCode_SQLiteRollbackWithoutTransaction = 1005 /*!< SQLite: Rolling back a nonexistent transaction (have you called Begin()?) */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
246 OrthancPluginErrorCode_SQLiteCommitWithoutTransaction = 1006 /*!< SQLite: Committing a nonexistent transaction */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
247 OrthancPluginErrorCode_SQLiteRegisterFunction = 1007 /*!< SQLite: Unable to register a function */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
248 OrthancPluginErrorCode_SQLiteFlush = 1008 /*!< SQLite: Unable to flush the database */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
249 OrthancPluginErrorCode_SQLiteCannotRun = 1009 /*!< SQLite: Cannot run a cached statement */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
250 OrthancPluginErrorCode_SQLiteCannotStep = 1010 /*!< SQLite: Cannot step over a cached statement */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
251 OrthancPluginErrorCode_SQLiteBindOutOfRange = 1011 /*!< SQLite: Bing a value while out of range (serious error) */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
252 OrthancPluginErrorCode_SQLitePrepareStatement = 1012 /*!< SQLite: Cannot prepare a cached statement */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
253 OrthancPluginErrorCode_SQLiteTransactionAlreadyStarted = 1013 /*!< SQLite: Beginning the same transaction twice */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
254 OrthancPluginErrorCode_SQLiteTransactionCommit = 1014 /*!< SQLite: Failure when committing the transaction */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
255 OrthancPluginErrorCode_SQLiteTransactionBegin = 1015 /*!< SQLite: Cannot start a transaction */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
256 OrthancPluginErrorCode_DirectoryOverFile = 2000 /*!< The directory to be created is already occupied by a regular file */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
257 OrthancPluginErrorCode_FileStorageCannotWrite = 2001 /*!< Unable to create a subdirectory or a file in the file storage */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
258 OrthancPluginErrorCode_DirectoryExpected = 2002 /*!< The specified path does not point to a directory */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
259 OrthancPluginErrorCode_HttpPortInUse = 2003 /*!< The TCP port of the HTTP server is privileged or already in use */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
260 OrthancPluginErrorCode_DicomPortInUse = 2004 /*!< The TCP port of the DICOM server is privileged or already in use */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
261 OrthancPluginErrorCode_BadHttpStatusInRest = 2005 /*!< This HTTP status is not allowed in a REST API */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
262 OrthancPluginErrorCode_RegularFileExpected = 2006 /*!< The specified path does not point to a regular file */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
263 OrthancPluginErrorCode_PathToExecutable = 2007 /*!< Unable to get the path to the executable */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
264 OrthancPluginErrorCode_MakeDirectory = 2008 /*!< Cannot create a directory */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
265 OrthancPluginErrorCode_BadApplicationEntityTitle = 2009 /*!< An application entity title (AET) cannot be empty or be longer than 16 characters */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
266 OrthancPluginErrorCode_NoCFindHandler = 2010 /*!< No request handler factory for DICOM C-FIND SCP */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
267 OrthancPluginErrorCode_NoCMoveHandler = 2011 /*!< No request handler factory for DICOM C-MOVE SCP */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
268 OrthancPluginErrorCode_NoCStoreHandler = 2012 /*!< No request handler factory for DICOM C-STORE SCP */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
269 OrthancPluginErrorCode_NoApplicationEntityFilter = 2013 /*!< No application entity filter */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
270 OrthancPluginErrorCode_NoSopClassOrInstance = 2014 /*!< DicomUserConnection: Unable to find the SOP class and instance */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
271 OrthancPluginErrorCode_NoPresentationContext = 2015 /*!< DicomUserConnection: No acceptable presentation context for modality */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
272 OrthancPluginErrorCode_DicomFindUnavailable = 2016 /*!< DicomUserConnection: The C-FIND command is not supported by the remote SCP */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
273 OrthancPluginErrorCode_DicomMoveUnavailable = 2017 /*!< DicomUserConnection: The C-MOVE command is not supported by the remote SCP */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
274 OrthancPluginErrorCode_CannotStoreInstance = 2018 /*!< Cannot store an instance */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
275 OrthancPluginErrorCode_CreateDicomNotString = 2019 /*!< Only string values are supported when creating DICOM instances */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
276 OrthancPluginErrorCode_CreateDicomOverrideTag = 2020 /*!< Trying to override a value inherited from a parent module */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
277 OrthancPluginErrorCode_CreateDicomUseContent = 2021 /*!< Use \"Content\" to inject an image into a new DICOM instance */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
278 OrthancPluginErrorCode_CreateDicomNoPayload = 2022 /*!< No payload is present for one instance in the series */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
279 OrthancPluginErrorCode_CreateDicomUseDataUriScheme = 2023 /*!< The payload of the DICOM instance must be specified according to Data URI scheme */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
280 OrthancPluginErrorCode_CreateDicomBadParent = 2024 /*!< Trying to attach a new DICOM instance to an inexistent resource */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
281 OrthancPluginErrorCode_CreateDicomParentIsInstance = 2025 /*!< Trying to attach a new DICOM instance to an instance (must be a series, study or patient) */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
282 OrthancPluginErrorCode_CreateDicomParentEncoding = 2026 /*!< Unable to get the encoding of the parent resource */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
283 OrthancPluginErrorCode_UnknownModality = 2027 /*!< Unknown modality */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
284 OrthancPluginErrorCode_BadJobOrdering = 2028 /*!< Bad ordering of filters in a job */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
285 OrthancPluginErrorCode_JsonToLuaTable = 2029 /*!< Cannot convert the given JSON object to a Lua table */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
286 OrthancPluginErrorCode_CannotCreateLua = 2030 /*!< Cannot create the Lua context */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
287 OrthancPluginErrorCode_CannotExecuteLua = 2031 /*!< Cannot execute a Lua command */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
288 OrthancPluginErrorCode_LuaAlreadyExecuted = 2032 /*!< Arguments cannot be pushed after the Lua function is executed */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
289 OrthancPluginErrorCode_LuaBadOutput = 2033 /*!< The Lua function does not give the expected number of outputs */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
290 OrthancPluginErrorCode_NotLuaPredicate = 2034 /*!< The Lua function is not a predicate (only true/false outputs allowed) */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
291 OrthancPluginErrorCode_LuaReturnsNoString = 2035 /*!< The Lua function does not return a string */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
292 OrthancPluginErrorCode_StorageAreaAlreadyRegistered = 2036 /*!< Another plugin has already registered a custom storage area */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
293 OrthancPluginErrorCode_DatabaseBackendAlreadyRegistered = 2037 /*!< Another plugin has already registered a custom database back-end */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
294 OrthancPluginErrorCode_DatabaseNotInitialized = 2038 /*!< Plugin trying to call the database during its initialization */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
295 OrthancPluginErrorCode_SslDisabled = 2039 /*!< Orthanc has been built without SSL support */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
296 OrthancPluginErrorCode_CannotOrderSlices = 2040 /*!< Unable to order the slices of the series */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
297 OrthancPluginErrorCode_NoWorklistHandler = 2041 /*!< No request handler factory for DICOM C-Find Modality SCP */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
298 OrthancPluginErrorCode_AlreadyExistingTag = 2042 /*!< Cannot override the value of a tag that already exists */,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
299
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
300 _OrthancPluginErrorCode_INTERNAL = 0x7fffffff
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
301 } OrthancPluginErrorCode;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
302
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
303
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
304 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
305 * Forward declaration of one of the mandatory functions for Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
306 * plugins.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
307 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
308 ORTHANC_PLUGINS_API const char* OrthancPluginGetName();
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
309
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
310
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
311 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
312 * The various HTTP methods for a REST call.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
313 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
314 typedef enum
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
315 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
316 OrthancPluginHttpMethod_Get = 1, /*!< GET request */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
317 OrthancPluginHttpMethod_Post = 2, /*!< POST request */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
318 OrthancPluginHttpMethod_Put = 3, /*!< PUT request */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
319 OrthancPluginHttpMethod_Delete = 4, /*!< DELETE request */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
320
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
321 _OrthancPluginHttpMethod_INTERNAL = 0x7fffffff
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
322 } OrthancPluginHttpMethod;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
323
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
324
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
325 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
326 * @brief The parameters of a REST request.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
327 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
328 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
329 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
330 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
331 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
332 * @brief The HTTP method.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
333 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
334 OrthancPluginHttpMethod method;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
335
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
336 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
337 * @brief The number of groups of the regular expression.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
338 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
339 uint32_t groupsCount;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
340
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
341 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
342 * @brief The matched values for the groups of the regular expression.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
343 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
344 const char* const* groups;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
345
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
346 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
347 * @brief For a GET request, the number of GET parameters.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
348 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
349 uint32_t getCount;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
350
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
351 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
352 * @brief For a GET request, the keys of the GET parameters.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
353 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
354 const char* const* getKeys;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
355
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
356 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
357 * @brief For a GET request, the values of the GET parameters.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
358 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
359 const char* const* getValues;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
360
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
361 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
362 * @brief For a PUT or POST request, the content of the body.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
363 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
364 const char* body;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
365
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
366 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
367 * @brief For a PUT or POST request, the number of bytes of the body.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
368 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
369 uint32_t bodySize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
370
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
371
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
372 /* --------------------------------------------------
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
373 New in version 0.8.1
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
374 -------------------------------------------------- */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
375
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
376 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
377 * @brief The number of HTTP headers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
378 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
379 uint32_t headersCount;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
380
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
381 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
382 * @brief The keys of the HTTP headers (always converted to low-case).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
383 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
384 const char* const* headersKeys;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
385
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
386 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
387 * @brief The values of the HTTP headers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
388 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
389 const char* const* headersValues;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
390
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
391 } OrthancPluginHttpRequest;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
392
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
393
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
394 typedef enum
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
395 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
396 /* Generic services */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
397 _OrthancPluginService_LogInfo = 1,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
398 _OrthancPluginService_LogWarning = 2,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
399 _OrthancPluginService_LogError = 3,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
400 _OrthancPluginService_GetOrthancPath = 4,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
401 _OrthancPluginService_GetOrthancDirectory = 5,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
402 _OrthancPluginService_GetConfigurationPath = 6,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
403 _OrthancPluginService_SetPluginProperty = 7,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
404 _OrthancPluginService_GetGlobalProperty = 8,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
405 _OrthancPluginService_SetGlobalProperty = 9,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
406 _OrthancPluginService_GetCommandLineArgumentsCount = 10,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
407 _OrthancPluginService_GetCommandLineArgument = 11,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
408 _OrthancPluginService_GetExpectedDatabaseVersion = 12,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
409 _OrthancPluginService_GetConfiguration = 13,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
410 _OrthancPluginService_BufferCompression = 14,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
411 _OrthancPluginService_ReadFile = 15,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
412 _OrthancPluginService_WriteFile = 16,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
413 _OrthancPluginService_GetErrorDescription = 17,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
414 _OrthancPluginService_CallHttpClient = 18,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
415 _OrthancPluginService_RegisterErrorCode = 19,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
416 _OrthancPluginService_RegisterDictionaryTag = 20,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
417 _OrthancPluginService_DicomBufferToJson = 21,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
418 _OrthancPluginService_DicomInstanceToJson = 22,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
419 _OrthancPluginService_CreateDicom = 23,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
420 _OrthancPluginService_ComputeMd5 = 24,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
421 _OrthancPluginService_ComputeSha1 = 25,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
422 _OrthancPluginService_LookupDictionary = 26,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
423 _OrthancPluginService_CallHttpClient2 = 27,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
424 _OrthancPluginService_GenerateUuid = 28,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
425 _OrthancPluginService_RegisterPrivateDictionaryTag = 29,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
426 _OrthancPluginService_AutodetectMimeType = 30,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
427
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
428 /* Registration of callbacks */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
429 _OrthancPluginService_RegisterRestCallback = 1000,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
430 _OrthancPluginService_RegisterOnStoredInstanceCallback = 1001,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
431 _OrthancPluginService_RegisterStorageArea = 1002,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
432 _OrthancPluginService_RegisterOnChangeCallback = 1003,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
433 _OrthancPluginService_RegisterRestCallbackNoLock = 1004,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
434 _OrthancPluginService_RegisterWorklistCallback = 1005,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
435 _OrthancPluginService_RegisterDecodeImageCallback = 1006,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
436 _OrthancPluginService_RegisterIncomingHttpRequestFilter = 1007,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
437 _OrthancPluginService_RegisterFindCallback = 1008,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
438 _OrthancPluginService_RegisterMoveCallback = 1009,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
439 _OrthancPluginService_RegisterIncomingHttpRequestFilter2 = 1010,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
440
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
441 /* Sending answers to REST calls */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
442 _OrthancPluginService_AnswerBuffer = 2000,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
443 _OrthancPluginService_CompressAndAnswerPngImage = 2001, /* Unused as of Orthanc 0.9.4 */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
444 _OrthancPluginService_Redirect = 2002,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
445 _OrthancPluginService_SendHttpStatusCode = 2003,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
446 _OrthancPluginService_SendUnauthorized = 2004,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
447 _OrthancPluginService_SendMethodNotAllowed = 2005,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
448 _OrthancPluginService_SetCookie = 2006,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
449 _OrthancPluginService_SetHttpHeader = 2007,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
450 _OrthancPluginService_StartMultipartAnswer = 2008,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
451 _OrthancPluginService_SendMultipartItem = 2009,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
452 _OrthancPluginService_SendHttpStatus = 2010,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
453 _OrthancPluginService_CompressAndAnswerImage = 2011,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
454 _OrthancPluginService_SendMultipartItem2 = 2012,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
455 _OrthancPluginService_SetHttpErrorDetails = 2013,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
456
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
457 /* Access to the Orthanc database and API */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
458 _OrthancPluginService_GetDicomForInstance = 3000,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
459 _OrthancPluginService_RestApiGet = 3001,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
460 _OrthancPluginService_RestApiPost = 3002,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
461 _OrthancPluginService_RestApiDelete = 3003,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
462 _OrthancPluginService_RestApiPut = 3004,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
463 _OrthancPluginService_LookupPatient = 3005,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
464 _OrthancPluginService_LookupStudy = 3006,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
465 _OrthancPluginService_LookupSeries = 3007,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
466 _OrthancPluginService_LookupInstance = 3008,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
467 _OrthancPluginService_LookupStudyWithAccessionNumber = 3009,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
468 _OrthancPluginService_RestApiGetAfterPlugins = 3010,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
469 _OrthancPluginService_RestApiPostAfterPlugins = 3011,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
470 _OrthancPluginService_RestApiDeleteAfterPlugins = 3012,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
471 _OrthancPluginService_RestApiPutAfterPlugins = 3013,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
472 _OrthancPluginService_ReconstructMainDicomTags = 3014,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
473 _OrthancPluginService_RestApiGet2 = 3015,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
474
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
475 /* Access to DICOM instances */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
476 _OrthancPluginService_GetInstanceRemoteAet = 4000,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
477 _OrthancPluginService_GetInstanceSize = 4001,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
478 _OrthancPluginService_GetInstanceData = 4002,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
479 _OrthancPluginService_GetInstanceJson = 4003,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
480 _OrthancPluginService_GetInstanceSimplifiedJson = 4004,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
481 _OrthancPluginService_HasInstanceMetadata = 4005,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
482 _OrthancPluginService_GetInstanceMetadata = 4006,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
483 _OrthancPluginService_GetInstanceOrigin = 4007,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
484
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
485 /* Services for plugins implementing a database back-end */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
486 _OrthancPluginService_RegisterDatabaseBackend = 5000,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
487 _OrthancPluginService_DatabaseAnswer = 5001,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
488 _OrthancPluginService_RegisterDatabaseBackendV2 = 5002,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
489 _OrthancPluginService_StorageAreaCreate = 5003,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
490 _OrthancPluginService_StorageAreaRead = 5004,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
491 _OrthancPluginService_StorageAreaRemove = 5005,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
492
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
493 /* Primitives for handling images */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
494 _OrthancPluginService_GetImagePixelFormat = 6000,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
495 _OrthancPluginService_GetImageWidth = 6001,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
496 _OrthancPluginService_GetImageHeight = 6002,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
497 _OrthancPluginService_GetImagePitch = 6003,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
498 _OrthancPluginService_GetImageBuffer = 6004,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
499 _OrthancPluginService_UncompressImage = 6005,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
500 _OrthancPluginService_FreeImage = 6006,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
501 _OrthancPluginService_CompressImage = 6007,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
502 _OrthancPluginService_ConvertPixelFormat = 6008,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
503 _OrthancPluginService_GetFontsCount = 6009,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
504 _OrthancPluginService_GetFontInfo = 6010,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
505 _OrthancPluginService_DrawText = 6011,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
506 _OrthancPluginService_CreateImage = 6012,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
507 _OrthancPluginService_CreateImageAccessor = 6013,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
508 _OrthancPluginService_DecodeDicomImage = 6014,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
509
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
510 /* Primitives for handling C-Find, C-Move and worklists */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
511 _OrthancPluginService_WorklistAddAnswer = 7000,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
512 _OrthancPluginService_WorklistMarkIncomplete = 7001,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
513 _OrthancPluginService_WorklistIsMatch = 7002,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
514 _OrthancPluginService_WorklistGetDicomQuery = 7003,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
515 _OrthancPluginService_FindAddAnswer = 7004,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
516 _OrthancPluginService_FindMarkIncomplete = 7005,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
517 _OrthancPluginService_GetFindQuerySize = 7006,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
518 _OrthancPluginService_GetFindQueryTag = 7007,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
519 _OrthancPluginService_GetFindQueryTagName = 7008,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
520 _OrthancPluginService_GetFindQueryValue = 7009,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
521 _OrthancPluginService_CreateFindMatcher = 7010,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
522 _OrthancPluginService_FreeFindMatcher = 7011,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
523 _OrthancPluginService_FindMatcherIsMatch = 7012,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
524
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
525 /* Primitives for accessing Orthanc Peers (new in 1.4.2) */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
526 _OrthancPluginService_GetPeers = 8000,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
527 _OrthancPluginService_FreePeers = 8001,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
528 _OrthancPluginService_GetPeersCount = 8003,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
529 _OrthancPluginService_GetPeerName = 8004,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
530 _OrthancPluginService_GetPeerUrl = 8005,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
531 _OrthancPluginService_CallPeerApi = 8006,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
532 _OrthancPluginService_GetPeerUserProperty = 8007,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
533
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
534 /* Primitives for handling jobs (new in 1.4.2) */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
535 _OrthancPluginService_CreateJob = 9000,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
536 _OrthancPluginService_FreeJob = 9001,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
537 _OrthancPluginService_SubmitJob = 9002,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
538 _OrthancPluginService_RegisterJobsUnserializer = 9003,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
539
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
540 _OrthancPluginService_INTERNAL = 0x7fffffff
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
541 } _OrthancPluginService;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
542
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
543
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
544 typedef enum
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
545 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
546 _OrthancPluginProperty_Description = 1,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
547 _OrthancPluginProperty_RootUri = 2,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
548 _OrthancPluginProperty_OrthancExplorer = 3,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
549
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
550 _OrthancPluginProperty_INTERNAL = 0x7fffffff
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
551 } _OrthancPluginProperty;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
552
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
553
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
554
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
555 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
556 * The memory layout of the pixels of an image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
557 * @ingroup Images
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
558 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
559 typedef enum
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
560 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
561 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
562 * @brief Graylevel 8bpp image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
563 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
564 * The image is graylevel. Each pixel is unsigned and stored in
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
565 * one byte.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
566 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
567 OrthancPluginPixelFormat_Grayscale8 = 1,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
568
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
569 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
570 * @brief Graylevel, unsigned 16bpp image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
571 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
572 * The image is graylevel. Each pixel is unsigned and stored in
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
573 * two bytes.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
574 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
575 OrthancPluginPixelFormat_Grayscale16 = 2,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
576
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
577 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
578 * @brief Graylevel, signed 16bpp image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
579 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
580 * The image is graylevel. Each pixel is signed and stored in two
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
581 * bytes.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
582 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
583 OrthancPluginPixelFormat_SignedGrayscale16 = 3,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
584
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
585 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
586 * @brief Color image in RGB24 format.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
587 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
588 * This format describes a color image. The pixels are stored in 3
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
589 * consecutive bytes. The memory layout is RGB.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
590 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
591 OrthancPluginPixelFormat_RGB24 = 4,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
592
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
593 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
594 * @brief Color image in RGBA32 format.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
595 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
596 * This format describes a color image. The pixels are stored in 4
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
597 * consecutive bytes. The memory layout is RGBA.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
598 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
599 OrthancPluginPixelFormat_RGBA32 = 5,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
600
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
601 OrthancPluginPixelFormat_Unknown = 6, /*!< Unknown pixel format */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
602
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
603 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
604 * @brief Color image in RGB48 format.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
605 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
606 * This format describes a color image. The pixels are stored in 6
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
607 * consecutive bytes. The memory layout is RRGGBB.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
608 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
609 OrthancPluginPixelFormat_RGB48 = 7,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
610
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
611 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
612 * @brief Graylevel, unsigned 32bpp image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
613 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
614 * The image is graylevel. Each pixel is unsigned and stored in
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
615 * four bytes.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
616 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
617 OrthancPluginPixelFormat_Grayscale32 = 8,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
618
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
619 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
620 * @brief Graylevel, floating-point 32bpp image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
621 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
622 * The image is graylevel. Each pixel is floating-point and stored
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
623 * in four bytes.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
624 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
625 OrthancPluginPixelFormat_Float32 = 9,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
626
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
627 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
628 * @brief Color image in BGRA32 format.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
629 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
630 * This format describes a color image. The pixels are stored in 4
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
631 * consecutive bytes. The memory layout is BGRA.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
632 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
633 OrthancPluginPixelFormat_BGRA32 = 10,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
634
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
635 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
636 * @brief Graylevel, unsigned 64bpp image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
637 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
638 * The image is graylevel. Each pixel is unsigned and stored in
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
639 * eight bytes.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
640 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
641 OrthancPluginPixelFormat_Grayscale64 = 11,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
642
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
643 _OrthancPluginPixelFormat_INTERNAL = 0x7fffffff
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
644 } OrthancPluginPixelFormat;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
645
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
646
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
647
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
648 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
649 * The content types that are supported by Orthanc plugins.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
650 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
651 typedef enum
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
652 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
653 OrthancPluginContentType_Unknown = 0, /*!< Unknown content type */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
654 OrthancPluginContentType_Dicom = 1, /*!< DICOM */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
655 OrthancPluginContentType_DicomAsJson = 2, /*!< JSON summary of a DICOM file */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
656
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
657 _OrthancPluginContentType_INTERNAL = 0x7fffffff
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
658 } OrthancPluginContentType;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
659
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
660
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
661
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
662 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
663 * The supported types of DICOM resources.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
664 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
665 typedef enum
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
666 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
667 OrthancPluginResourceType_Patient = 0, /*!< Patient */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
668 OrthancPluginResourceType_Study = 1, /*!< Study */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
669 OrthancPluginResourceType_Series = 2, /*!< Series */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
670 OrthancPluginResourceType_Instance = 3, /*!< Instance */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
671 OrthancPluginResourceType_None = 4, /*!< Unavailable resource type */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
672
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
673 _OrthancPluginResourceType_INTERNAL = 0x7fffffff
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
674 } OrthancPluginResourceType;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
675
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
676
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
677
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
678 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
679 * The supported types of changes that can happen to DICOM resources.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
680 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
681 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
682 typedef enum
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
683 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
684 OrthancPluginChangeType_CompletedSeries = 0, /*!< Series is now complete */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
685 OrthancPluginChangeType_Deleted = 1, /*!< Deleted resource */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
686 OrthancPluginChangeType_NewChildInstance = 2, /*!< A new instance was added to this resource */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
687 OrthancPluginChangeType_NewInstance = 3, /*!< New instance received */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
688 OrthancPluginChangeType_NewPatient = 4, /*!< New patient created */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
689 OrthancPluginChangeType_NewSeries = 5, /*!< New series created */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
690 OrthancPluginChangeType_NewStudy = 6, /*!< New study created */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
691 OrthancPluginChangeType_StablePatient = 7, /*!< Timeout: No new instance in this patient */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
692 OrthancPluginChangeType_StableSeries = 8, /*!< Timeout: No new instance in this series */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
693 OrthancPluginChangeType_StableStudy = 9, /*!< Timeout: No new instance in this study */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
694 OrthancPluginChangeType_OrthancStarted = 10, /*!< Orthanc has started */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
695 OrthancPluginChangeType_OrthancStopped = 11, /*!< Orthanc is stopping */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
696 OrthancPluginChangeType_UpdatedAttachment = 12, /*!< Some user-defined attachment has changed for this resource */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
697 OrthancPluginChangeType_UpdatedMetadata = 13, /*!< Some user-defined metadata has changed for this resource */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
698 OrthancPluginChangeType_UpdatedPeers = 14, /*!< The list of Orthanc peers has changed */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
699 OrthancPluginChangeType_UpdatedModalities = 15, /*!< The list of DICOM modalities has changed */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
700
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
701 _OrthancPluginChangeType_INTERNAL = 0x7fffffff
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
702 } OrthancPluginChangeType;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
703
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
704
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
705 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
706 * The compression algorithms that are supported by the Orthanc core.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
707 * @ingroup Images
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
708 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
709 typedef enum
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
710 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
711 OrthancPluginCompressionType_Zlib = 0, /*!< Standard zlib compression */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
712 OrthancPluginCompressionType_ZlibWithSize = 1, /*!< zlib, prefixed with uncompressed size (uint64_t) */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
713 OrthancPluginCompressionType_Gzip = 2, /*!< Standard gzip compression */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
714 OrthancPluginCompressionType_GzipWithSize = 3, /*!< gzip, prefixed with uncompressed size (uint64_t) */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
715
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
716 _OrthancPluginCompressionType_INTERNAL = 0x7fffffff
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
717 } OrthancPluginCompressionType;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
718
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
719
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
720 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
721 * The image formats that are supported by the Orthanc core.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
722 * @ingroup Images
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
723 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
724 typedef enum
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
725 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
726 OrthancPluginImageFormat_Png = 0, /*!< Image compressed using PNG */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
727 OrthancPluginImageFormat_Jpeg = 1, /*!< Image compressed using JPEG */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
728 OrthancPluginImageFormat_Dicom = 2, /*!< Image compressed using DICOM */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
729
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
730 _OrthancPluginImageFormat_INTERNAL = 0x7fffffff
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
731 } OrthancPluginImageFormat;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
732
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
733
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
734 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
735 * The value representations present in the DICOM standard (version 2013).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
736 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
737 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
738 typedef enum
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
739 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
740 OrthancPluginValueRepresentation_AE = 1, /*!< Application Entity */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
741 OrthancPluginValueRepresentation_AS = 2, /*!< Age String */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
742 OrthancPluginValueRepresentation_AT = 3, /*!< Attribute Tag */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
743 OrthancPluginValueRepresentation_CS = 4, /*!< Code String */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
744 OrthancPluginValueRepresentation_DA = 5, /*!< Date */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
745 OrthancPluginValueRepresentation_DS = 6, /*!< Decimal String */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
746 OrthancPluginValueRepresentation_DT = 7, /*!< Date Time */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
747 OrthancPluginValueRepresentation_FD = 8, /*!< Floating Point Double */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
748 OrthancPluginValueRepresentation_FL = 9, /*!< Floating Point Single */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
749 OrthancPluginValueRepresentation_IS = 10, /*!< Integer String */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
750 OrthancPluginValueRepresentation_LO = 11, /*!< Long String */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
751 OrthancPluginValueRepresentation_LT = 12, /*!< Long Text */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
752 OrthancPluginValueRepresentation_OB = 13, /*!< Other Byte String */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
753 OrthancPluginValueRepresentation_OF = 14, /*!< Other Float String */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
754 OrthancPluginValueRepresentation_OW = 15, /*!< Other Word String */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
755 OrthancPluginValueRepresentation_PN = 16, /*!< Person Name */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
756 OrthancPluginValueRepresentation_SH = 17, /*!< Short String */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
757 OrthancPluginValueRepresentation_SL = 18, /*!< Signed Long */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
758 OrthancPluginValueRepresentation_SQ = 19, /*!< Sequence of Items */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
759 OrthancPluginValueRepresentation_SS = 20, /*!< Signed Short */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
760 OrthancPluginValueRepresentation_ST = 21, /*!< Short Text */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
761 OrthancPluginValueRepresentation_TM = 22, /*!< Time */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
762 OrthancPluginValueRepresentation_UI = 23, /*!< Unique Identifier (UID) */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
763 OrthancPluginValueRepresentation_UL = 24, /*!< Unsigned Long */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
764 OrthancPluginValueRepresentation_UN = 25, /*!< Unknown */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
765 OrthancPluginValueRepresentation_US = 26, /*!< Unsigned Short */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
766 OrthancPluginValueRepresentation_UT = 27, /*!< Unlimited Text */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
767
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
768 _OrthancPluginValueRepresentation_INTERNAL = 0x7fffffff
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
769 } OrthancPluginValueRepresentation;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
770
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
771
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
772 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
773 * The possible output formats for a DICOM-to-JSON conversion.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
774 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
775 * @see OrthancPluginDicomToJson()
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
776 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
777 typedef enum
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
778 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
779 OrthancPluginDicomToJsonFormat_Full = 1, /*!< Full output, with most details */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
780 OrthancPluginDicomToJsonFormat_Short = 2, /*!< Tags output as hexadecimal numbers */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
781 OrthancPluginDicomToJsonFormat_Human = 3, /*!< Human-readable JSON */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
782
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
783 _OrthancPluginDicomToJsonFormat_INTERNAL = 0x7fffffff
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
784 } OrthancPluginDicomToJsonFormat;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
785
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
786
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
787 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
788 * Flags to customize a DICOM-to-JSON conversion. By default, binary
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
789 * tags are formatted using Data URI scheme.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
790 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
791 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
792 typedef enum
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
793 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
794 OrthancPluginDicomToJsonFlags_None = 0,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
795 OrthancPluginDicomToJsonFlags_IncludeBinary = (1 << 0), /*!< Include the binary tags */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
796 OrthancPluginDicomToJsonFlags_IncludePrivateTags = (1 << 1), /*!< Include the private tags */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
797 OrthancPluginDicomToJsonFlags_IncludeUnknownTags = (1 << 2), /*!< Include the tags unknown by the dictionary */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
798 OrthancPluginDicomToJsonFlags_IncludePixelData = (1 << 3), /*!< Include the pixel data */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
799 OrthancPluginDicomToJsonFlags_ConvertBinaryToAscii = (1 << 4), /*!< Output binary tags as-is, dropping non-ASCII */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
800 OrthancPluginDicomToJsonFlags_ConvertBinaryToNull = (1 << 5), /*!< Signal binary tags as null values */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
801
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
802 _OrthancPluginDicomToJsonFlags_INTERNAL = 0x7fffffff
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
803 } OrthancPluginDicomToJsonFlags;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
804
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
805
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
806 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
807 * Flags to the creation of a DICOM file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
808 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
809 * @see OrthancPluginCreateDicom()
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
810 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
811 typedef enum
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
812 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
813 OrthancPluginCreateDicomFlags_None = 0,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
814 OrthancPluginCreateDicomFlags_DecodeDataUriScheme = (1 << 0), /*!< Decode fields encoded using data URI scheme */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
815 OrthancPluginCreateDicomFlags_GenerateIdentifiers = (1 << 1), /*!< Automatically generate DICOM identifiers */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
816
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
817 _OrthancPluginCreateDicomFlags_INTERNAL = 0x7fffffff
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
818 } OrthancPluginCreateDicomFlags;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
819
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
820
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
821 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
822 * The constraints on the DICOM identifiers that must be supported
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
823 * by the database plugins.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
824 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
825 typedef enum
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
826 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
827 OrthancPluginIdentifierConstraint_Equal = 1, /*!< Equal */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
828 OrthancPluginIdentifierConstraint_SmallerOrEqual = 2, /*!< Less or equal */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
829 OrthancPluginIdentifierConstraint_GreaterOrEqual = 3, /*!< More or equal */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
830 OrthancPluginIdentifierConstraint_Wildcard = 4, /*!< Case-sensitive wildcard matching (with * and ?) */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
831
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
832 _OrthancPluginIdentifierConstraint_INTERNAL = 0x7fffffff
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
833 } OrthancPluginIdentifierConstraint;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
834
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
835
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
836 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
837 * The origin of a DICOM instance that has been received by Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
838 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
839 typedef enum
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
840 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
841 OrthancPluginInstanceOrigin_Unknown = 1, /*!< Unknown origin */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
842 OrthancPluginInstanceOrigin_DicomProtocol = 2, /*!< Instance received through DICOM protocol */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
843 OrthancPluginInstanceOrigin_RestApi = 3, /*!< Instance received through REST API of Orthanc */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
844 OrthancPluginInstanceOrigin_Plugin = 4, /*!< Instance added to Orthanc by a plugin */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
845 OrthancPluginInstanceOrigin_Lua = 5, /*!< Instance added to Orthanc by a Lua script */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
846
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
847 _OrthancPluginInstanceOrigin_INTERNAL = 0x7fffffff
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
848 } OrthancPluginInstanceOrigin;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
849
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
850
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
851 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
852 * The possible status for one single step of a job.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
853 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
854 typedef enum
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
855 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
856 OrthancPluginJobStepStatus_Success = 1, /*!< The job has successfully executed all its steps */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
857 OrthancPluginJobStepStatus_Failure = 2, /*!< The job has failed while executing this step */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
858 OrthancPluginJobStepStatus_Continue = 3 /*!< The job has still data to process after this step */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
859 } OrthancPluginJobStepStatus;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
860
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
861
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
862 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
863 * Explains why the job should stop and release the resources it has
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
864 * allocated. This is especially important to disambiguate between
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
865 * the "paused" condition and the "final" conditions (success,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
866 * failure, or canceled).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
867 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
868 typedef enum
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
869 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
870 OrthancPluginJobStopReason_Success = 1, /*!< The job has succeeded */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
871 OrthancPluginJobStopReason_Paused = 2, /*!< The job was paused, and will be resumed later */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
872 OrthancPluginJobStopReason_Failure = 3, /*!< The job has failed, and might be resubmitted later */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
873 OrthancPluginJobStopReason_Canceled = 4 /*!< The job was canceled, and might be resubmitted later */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
874 } OrthancPluginJobStopReason;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
875
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
876
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
877 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
878 * @brief A memory buffer allocated by the core system of Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
879 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
880 * A memory buffer allocated by the core system of Orthanc. When the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
881 * content of the buffer is not useful anymore, it must be free by a
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
882 * call to ::OrthancPluginFreeMemoryBuffer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
883 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
884 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
885 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
886 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
887 * @brief The content of the buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
888 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
889 void* data;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
890
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
891 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
892 * @brief The number of bytes in the buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
893 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
894 uint32_t size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
895 } OrthancPluginMemoryBuffer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
896
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
897
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
898
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
899
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
900 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
901 * @brief Opaque structure that represents the HTTP connection to the client application.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
902 * @ingroup Callback
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
903 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
904 typedef struct _OrthancPluginRestOutput_t OrthancPluginRestOutput;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
905
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
906
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
907
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
908 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
909 * @brief Opaque structure that represents a DICOM instance received by Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
910 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
911 typedef struct _OrthancPluginDicomInstance_t OrthancPluginDicomInstance;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
912
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
913
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
914
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
915 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
916 * @brief Opaque structure that represents an image that is uncompressed in memory.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
917 * @ingroup Images
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
918 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
919 typedef struct _OrthancPluginImage_t OrthancPluginImage;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
920
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
921
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
922
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
923 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
924 * @brief Opaque structure that represents the storage area that is actually used by Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
925 * @ingroup Images
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
926 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
927 typedef struct _OrthancPluginStorageArea_t OrthancPluginStorageArea;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
928
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
929
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
930
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
931 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
932 * @brief Opaque structure to an object that represents a C-Find query for worklists.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
933 * @ingroup DicomCallbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
934 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
935 typedef struct _OrthancPluginWorklistQuery_t OrthancPluginWorklistQuery;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
936
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
937
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
938
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
939 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
940 * @brief Opaque structure to an object that represents the answers to a C-Find query for worklists.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
941 * @ingroup DicomCallbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
942 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
943 typedef struct _OrthancPluginWorklistAnswers_t OrthancPluginWorklistAnswers;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
944
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
945
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
946
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
947 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
948 * @brief Opaque structure to an object that represents a C-Find query.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
949 * @ingroup DicomCallbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
950 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
951 typedef struct _OrthancPluginFindQuery_t OrthancPluginFindQuery;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
952
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
953
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
954
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
955 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
956 * @brief Opaque structure to an object that represents the answers to a C-Find query for worklists.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
957 * @ingroup DicomCallbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
958 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
959 typedef struct _OrthancPluginFindAnswers_t OrthancPluginFindAnswers;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
960
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
961
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
962
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
963 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
964 * @brief Opaque structure to an object that can be used to check whether a DICOM instance matches a C-Find query.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
965 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
966 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
967 typedef struct _OrthancPluginFindAnswers_t OrthancPluginFindMatcher;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
968
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
969
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
970
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
971 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
972 * @brief Opaque structure to the set of remote Orthanc Peers that are known to the local Orthanc server.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
973 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
974 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
975 typedef struct _OrthancPluginPeers_t OrthancPluginPeers;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
976
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
977
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
978
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
979 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
980 * @brief Opaque structure to a job to be executed by Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
981 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
982 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
983 typedef struct _OrthancPluginJob_t OrthancPluginJob;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
984
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
985
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
986
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
987 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
988 * @brief Signature of a callback function that answers to a REST request.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
989 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
990 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
991 typedef OrthancPluginErrorCode (*OrthancPluginRestCallback) (
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
992 OrthancPluginRestOutput* output,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
993 const char* url,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
994 const OrthancPluginHttpRequest* request);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
995
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
996
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
997
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
998 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
999 * @brief Signature of a callback function that is triggered when Orthanc receives a DICOM instance.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1000 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1001 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1002 typedef OrthancPluginErrorCode (*OrthancPluginOnStoredInstanceCallback) (
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1003 OrthancPluginDicomInstance* instance,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1004 const char* instanceId);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1005
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1006
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1007
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1008 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1009 * @brief Signature of a callback function that is triggered when a change happens to some DICOM resource.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1010 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1011 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1012 typedef OrthancPluginErrorCode (*OrthancPluginOnChangeCallback) (
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1013 OrthancPluginChangeType changeType,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1014 OrthancPluginResourceType resourceType,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1015 const char* resourceId);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1016
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1017
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1018
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1019 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1020 * @brief Signature of a callback function to decode a DICOM instance as an image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1021 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1022 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1023 typedef OrthancPluginErrorCode (*OrthancPluginDecodeImageCallback) (
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1024 OrthancPluginImage** target,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1025 const void* dicom,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1026 const uint32_t size,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1027 uint32_t frameIndex);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1028
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1029
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1030
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1031 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1032 * @brief Signature of a function to free dynamic memory.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1033 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1034 typedef void (*OrthancPluginFree) (void* buffer);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1035
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1036
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1037
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1038 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1039 * @brief Callback for writing to the storage area.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1040 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1041 * Signature of a callback function that is triggered when Orthanc writes a file to the storage area.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1042 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1043 * @param uuid The UUID of the file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1044 * @param content The content of the file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1045 * @param size The size of the file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1046 * @param type The content type corresponding to this file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1047 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1048 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1049 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1050 typedef OrthancPluginErrorCode (*OrthancPluginStorageCreate) (
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1051 const char* uuid,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1052 const void* content,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1053 int64_t size,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1054 OrthancPluginContentType type);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1055
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1056
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1057
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1058 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1059 * @brief Callback for reading from the storage area.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1060 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1061 * Signature of a callback function that is triggered when Orthanc reads a file from the storage area.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1062 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1063 * @param content The content of the file (output).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1064 * @param size The size of the file (output).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1065 * @param uuid The UUID of the file of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1066 * @param type The content type corresponding to this file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1067 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1068 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1069 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1070 typedef OrthancPluginErrorCode (*OrthancPluginStorageRead) (
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1071 void** content,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1072 int64_t* size,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1073 const char* uuid,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1074 OrthancPluginContentType type);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1075
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1076
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1077
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1078 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1079 * @brief Callback for removing a file from the storage area.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1080 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1081 * Signature of a callback function that is triggered when Orthanc deletes a file from the storage area.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1082 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1083 * @param uuid The UUID of the file to be removed.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1084 * @param type The content type corresponding to this file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1085 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1086 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1087 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1088 typedef OrthancPluginErrorCode (*OrthancPluginStorageRemove) (
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1089 const char* uuid,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1090 OrthancPluginContentType type);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1091
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1092
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1093
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1094 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1095 * @brief Callback to handle the C-Find SCP requests for worklists.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1096 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1097 * Signature of a callback function that is triggered when Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1098 * receives a C-Find SCP request against modality worklists.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1099 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1100 * @param answers The target structure where answers must be stored.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1101 * @param query The worklist query.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1102 * @param issuerAet The Application Entity Title (AET) of the modality from which the request originates.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1103 * @param calledAet The Application Entity Title (AET) of the modality that is called by the request.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1104 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1105 * @ingroup DicomCallbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1106 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1107 typedef OrthancPluginErrorCode (*OrthancPluginWorklistCallback) (
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1108 OrthancPluginWorklistAnswers* answers,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1109 const OrthancPluginWorklistQuery* query,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1110 const char* issuerAet,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1111 const char* calledAet);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1112
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1113
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1114
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1115 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1116 * @brief Callback to filter incoming HTTP requests received by Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1117 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1118 * Signature of a callback function that is triggered whenever
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1119 * Orthanc receives an HTTP/REST request, and that answers whether
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1120 * this request should be allowed. If the callback returns "0"
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1121 * ("false"), the server answers with HTTP status code 403
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1122 * (Forbidden).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1123 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1124 * @param method The HTTP method used by the request.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1125 * @param uri The URI of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1126 * @param ip The IP address of the HTTP client.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1127 * @param headersCount The number of HTTP headers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1128 * @param headersKeys The keys of the HTTP headers (always converted to low-case).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1129 * @param headersValues The values of the HTTP headers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1130 * @return 0 if forbidden access, 1 if allowed access, -1 if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1131 * @ingroup Callback
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1132 * @deprecated Please instead use OrthancPluginIncomingHttpRequestFilter2()
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1133 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1134 typedef int32_t (*OrthancPluginIncomingHttpRequestFilter) (
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1135 OrthancPluginHttpMethod method,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1136 const char* uri,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1137 const char* ip,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1138 uint32_t headersCount,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1139 const char* const* headersKeys,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1140 const char* const* headersValues);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1141
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1142
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1143
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1144 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1145 * @brief Callback to filter incoming HTTP requests received by Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1146 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1147 * Signature of a callback function that is triggered whenever
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1148 * Orthanc receives an HTTP/REST request, and that answers whether
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1149 * this request should be allowed. If the callback returns "0"
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1150 * ("false"), the server answers with HTTP status code 403
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1151 * (Forbidden).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1152 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1153 * @param method The HTTP method used by the request.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1154 * @param uri The URI of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1155 * @param ip The IP address of the HTTP client.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1156 * @param headersCount The number of HTTP headers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1157 * @param headersKeys The keys of the HTTP headers (always converted to low-case).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1158 * @param headersValues The values of the HTTP headers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1159 * @param getArgumentsCount The number of GET arguments (only for the GET HTTP method).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1160 * @param getArgumentsKeys The keys of the GET arguments (only for the GET HTTP method).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1161 * @param getArgumentsValues The values of the GET arguments (only for the GET HTTP method).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1162 * @return 0 if forbidden access, 1 if allowed access, -1 if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1163 * @ingroup Callback
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1164 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1165 typedef int32_t (*OrthancPluginIncomingHttpRequestFilter2) (
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1166 OrthancPluginHttpMethod method,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1167 const char* uri,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1168 const char* ip,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1169 uint32_t headersCount,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1170 const char* const* headersKeys,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1171 const char* const* headersValues,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1172 uint32_t getArgumentsCount,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1173 const char* const* getArgumentsKeys,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1174 const char* const* getArgumentsValues);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1175
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1176
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1177
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1178 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1179 * @brief Callback to handle incoming C-Find SCP requests.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1180 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1181 * Signature of a callback function that is triggered whenever
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1182 * Orthanc receives a C-Find SCP request not concerning modality
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1183 * worklists.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1184 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1185 * @param answers The target structure where answers must be stored.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1186 * @param query The worklist query.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1187 * @param issuerAet The Application Entity Title (AET) of the modality from which the request originates.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1188 * @param calledAet The Application Entity Title (AET) of the modality that is called by the request.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1189 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1190 * @ingroup DicomCallbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1191 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1192 typedef OrthancPluginErrorCode (*OrthancPluginFindCallback) (
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1193 OrthancPluginFindAnswers* answers,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1194 const OrthancPluginFindQuery* query,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1195 const char* issuerAet,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1196 const char* calledAet);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1197
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1198
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1199
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1200 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1201 * @brief Callback to handle incoming C-Move SCP requests.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1202 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1203 * Signature of a callback function that is triggered whenever
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1204 * Orthanc receives a C-Move SCP request. The callback receives the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1205 * type of the resource of interest (study, series, instance...)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1206 * together with the DICOM tags containing its identifiers. In turn,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1207 * the plugin must create a driver object that will be responsible
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1208 * for driving the successive move suboperations.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1209 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1210 * @param resourceType The type of the resource of interest. Note
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1211 * that this might be set to ResourceType_None if the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1212 * QueryRetrieveLevel (0008,0052) tag was not provided by the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1213 * issuer (i.e. the originator modality).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1214 * @param patientId Content of the PatientID (0x0010, 0x0020) tag of the resource of interest. Might be NULL.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1215 * @param accessionNumber Content of the AccessionNumber (0x0008, 0x0050) tag. Might be NULL.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1216 * @param studyInstanceUid Content of the StudyInstanceUID (0x0020, 0x000d) tag. Might be NULL.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1217 * @param seriesInstanceUid Content of the SeriesInstanceUID (0x0020, 0x000e) tag. Might be NULL.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1218 * @param sopInstanceUid Content of the SOPInstanceUID (0x0008, 0x0018) tag. Might be NULL.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1219 * @param originatorAet The Application Entity Title (AET) of the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1220 * modality from which the request originates.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1221 * @param sourceAet The Application Entity Title (AET) of the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1222 * modality that should send its DICOM files to another modality.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1223 * @param targetAet The Application Entity Title (AET) of the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1224 * modality that should receive the DICOM files.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1225 * @param originatorId The Message ID issued by the originator modality,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1226 * as found in tag (0000,0110) of the DICOM query emitted by the issuer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1227 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1228 * @return The NULL value if the plugin cannot deal with this query,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1229 * or a pointer to the driver object that is responsible for
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1230 * handling the successive move suboperations.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1231 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1232 * @note If targetAet equals sourceAet, this is actually a query/retrieve operation.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1233 * @ingroup DicomCallbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1234 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1235 typedef void* (*OrthancPluginMoveCallback) (
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1236 OrthancPluginResourceType resourceType,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1237 const char* patientId,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1238 const char* accessionNumber,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1239 const char* studyInstanceUid,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1240 const char* seriesInstanceUid,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1241 const char* sopInstanceUid,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1242 const char* originatorAet,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1243 const char* sourceAet,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1244 const char* targetAet,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1245 uint16_t originatorId);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1246
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1247
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1248 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1249 * @brief Callback to read the size of a C-Move driver.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1250 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1251 * Signature of a callback function that returns the number of
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1252 * C-Move suboperations that are to be achieved by the given C-Move
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1253 * driver. This driver is the return value of a previous call to the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1254 * OrthancPluginMoveCallback() callback.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1255 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1256 * @param moveDriver The C-Move driver of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1257 * @return The number of suboperations.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1258 * @ingroup DicomCallbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1259 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1260 typedef uint32_t (*OrthancPluginGetMoveSize) (void* moveDriver);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1261
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1262
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1263 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1264 * @brief Callback to apply one C-Move suboperation.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1265 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1266 * Signature of a callback function that applies the next C-Move
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1267 * suboperation that os to be achieved by the given C-Move
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1268 * driver. This driver is the return value of a previous call to the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1269 * OrthancPluginMoveCallback() callback.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1270 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1271 * @param moveDriver The C-Move driver of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1272 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1273 * @ingroup DicomCallbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1274 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1275 typedef OrthancPluginErrorCode (*OrthancPluginApplyMove) (void* moveDriver);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1276
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1277
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1278 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1279 * @brief Callback to free one C-Move driver.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1280 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1281 * Signature of a callback function that releases the resources
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1282 * allocated by the given C-Move driver. This driver is the return
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1283 * value of a previous call to the OrthancPluginMoveCallback()
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1284 * callback.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1285 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1286 * @param moveDriver The C-Move driver of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1287 * @ingroup DicomCallbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1288 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1289 typedef void (*OrthancPluginFreeMove) (void* moveDriver);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1290
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1291
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1292 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1293 * @brief Callback to finalize one custom job.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1294 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1295 * Signature of a callback function that releases all the resources
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1296 * allocated by the given job. This job is the argument provided to
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1297 * OrthancPluginCreateJob().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1298 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1299 * @param job The job of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1300 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1301 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1302 typedef void (*OrthancPluginJobFinalize) (void* job);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1303
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1304
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1305 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1306 * @brief Callback to check the progress of one custom job.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1307 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1308 * Signature of a callback function that returns the progress of the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1309 * job.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1310 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1311 * @param job The job of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1312 * @return The progress, as a floating-point number ranging from 0 to 1.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1313 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1314 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1315 typedef float (*OrthancPluginJobGetProgress) (void* job);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1316
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1317
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1318 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1319 * @brief Callback to retrieve the content of one custom job.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1320 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1321 * Signature of a callback function that returns human-readable
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1322 * statistics about the job. This statistics must be formatted as a
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1323 * JSON object. This information is notably displayed in the "Jobs"
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1324 * tab of "Orthanc Explorer".
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1325 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1326 * @param job The job of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1327 * @return The statistics, as a JSON object encoded as a string.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1328 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1329 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1330 typedef const char* (*OrthancPluginJobGetContent) (void* job);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1331
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1332
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1333 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1334 * @brief Callback to serialize one custom job.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1335 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1336 * Signature of a callback function that returns a serialized
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1337 * version of the job, formatted as a JSON object. This
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1338 * serialization is stored in the Orthanc database, and is used to
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1339 * reload the job on the restart of Orthanc. The "unserialization"
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1340 * callback (with OrthancPluginJobsUnserializer signature) will
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1341 * receive this serialized object.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1342 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1343 * @param job The job of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1344 * @return The serialized job, as a JSON object encoded as a string.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1345 * @see OrthancPluginRegisterJobsUnserializer()
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1346 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1347 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1348 typedef const char* (*OrthancPluginJobGetSerialized) (void* job);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1349
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1350
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1351 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1352 * @brief Callback to execute one step of a custom job.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1353 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1354 * Signature of a callback function that executes one step in the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1355 * job. The jobs engine of Orthanc will make successive calls to
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1356 * this method, as long as it returns
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1357 * OrthancPluginJobStepStatus_Continue.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1358 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1359 * @param job The job of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1360 * @return The status of execution.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1361 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1362 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1363 typedef OrthancPluginJobStepStatus (*OrthancPluginJobStep) (void* job);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1364
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1365
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1366 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1367 * @brief Callback executed once one custom job leaves the "running" state.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1368 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1369 * Signature of a callback function that is invoked once a job
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1370 * leaves the "running" state. This can happen if the previous call
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1371 * to OrthancPluginJobStep has failed/succeeded, if the host Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1372 * server is being stopped, or if the user manually tags the job as
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1373 * paused/canceled. This callback allows the plugin to free
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1374 * resources allocated for running this custom job (e.g. to stop
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1375 * threads, or to remove temporary files).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1376 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1377 * Note that handling pauses might involves a specific treatment
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1378 * (such a stopping threads, but keeping temporary files on the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1379 * disk). This "paused" situation can be checked by looking at the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1380 * "reason" parameter.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1381 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1382 * @param job The job of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1383 * @param reason The reason for leaving the "running" state.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1384 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1385 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1386 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1387 typedef OrthancPluginErrorCode (*OrthancPluginJobStop) (void* job,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1388 OrthancPluginJobStopReason reason);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1389
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1390
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1391 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1392 * @brief Callback executed once one stopped custom job is started again.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1393 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1394 * Signature of a callback function that is invoked once a job
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1395 * leaves the "failure/canceled" state, to be started again. This
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1396 * function will typically reset the progress to zero. Note that
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1397 * before being actually executed, the job would first be tagged as
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1398 * "pending" in the Orthanc jobs engine.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1399 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1400 * @param job The job of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1401 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1402 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1403 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1404 typedef OrthancPluginErrorCode (*OrthancPluginJobReset) (void* job);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1405
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1406
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1407 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1408 * @brief Callback executed to unserialized a custom job.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1409 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1410 * Signature of a callback function that unserializes a job that was
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1411 * saved in the Orthanc database.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1412 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1413 * @param jobType The type of the job, as provided to OrthancPluginCreateJob().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1414 * @param serialized The serialization of the job, as provided by OrthancPluginJobGetSerialized.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1415 * @return The unserialized job (as created by OrthancPluginCreateJob()), or NULL
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1416 * if this unserializer cannot handle this job type.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1417 * @see OrthancPluginRegisterJobsUnserializer()
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1418 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1419 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1420 typedef OrthancPluginJob* (*OrthancPluginJobsUnserializer) (const char* jobType,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1421 const char* serialized);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1422
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1423
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1424
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1425 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1426 * @brief Data structure that contains information about the Orthanc core.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1427 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1428 typedef struct _OrthancPluginContext_t
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1429 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1430 void* pluginsManager;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1431 const char* orthancVersion;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1432 OrthancPluginFree Free;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1433 OrthancPluginErrorCode (*InvokeService) (struct _OrthancPluginContext_t* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1434 _OrthancPluginService service,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1435 const void* params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1436 } OrthancPluginContext;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1437
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1438
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1439
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1440 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1441 * @brief An entry in the dictionary of DICOM tags.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1442 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1443 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1444 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1445 uint16_t group; /*!< The group of the tag */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1446 uint16_t element; /*!< The element of the tag */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1447 OrthancPluginValueRepresentation vr; /*!< The value representation of the tag */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1448 uint32_t minMultiplicity; /*!< The minimum multiplicity of the tag */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1449 uint32_t maxMultiplicity; /*!< The maximum multiplicity of the tag (0 means arbitrary) */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1450 } OrthancPluginDictionaryEntry;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1451
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1452
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1453
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1454 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1455 * @brief Free a string.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1456 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1457 * Free a string that was allocated by the core system of Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1458 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1459 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1460 * @param str The string to be freed.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1461 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1462 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeString(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1463 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1464 char* str)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1465 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1466 if (str != NULL)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1467 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1468 context->Free(str);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1469 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1470 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1471
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1472
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1473 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1474 * @brief Check that the version of the hosting Orthanc is above a given version.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1475 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1476 * This function checks whether the version of the Orthanc server
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1477 * running this plugin, is above the given version. Contrarily to
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1478 * OrthancPluginCheckVersion(), it is up to the developer of the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1479 * plugin to make sure that all the Orthanc SDK services called by
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1480 * the plugin are actually implemented in the given version of
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1481 * Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1482 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1483 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1484 * @param expectedMajor Expected major version.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1485 * @param expectedMinor Expected minor version.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1486 * @param expectedRevision Expected revision.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1487 * @return 1 if and only if the versions are compatible. If the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1488 * result is 0, the initialization of the plugin should fail.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1489 * @see OrthancPluginCheckVersion
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1490 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1491 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1492 ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersionAdvanced(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1493 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1494 int expectedMajor,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1495 int expectedMinor,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1496 int expectedRevision)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1497 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1498 int major, minor, revision;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1499
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1500 if (sizeof(int32_t) != sizeof(OrthancPluginErrorCode) ||
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1501 sizeof(int32_t) != sizeof(OrthancPluginHttpMethod) ||
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1502 sizeof(int32_t) != sizeof(_OrthancPluginService) ||
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1503 sizeof(int32_t) != sizeof(_OrthancPluginProperty) ||
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1504 sizeof(int32_t) != sizeof(OrthancPluginPixelFormat) ||
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1505 sizeof(int32_t) != sizeof(OrthancPluginContentType) ||
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1506 sizeof(int32_t) != sizeof(OrthancPluginResourceType) ||
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1507 sizeof(int32_t) != sizeof(OrthancPluginChangeType) ||
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1508 sizeof(int32_t) != sizeof(OrthancPluginCompressionType) ||
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1509 sizeof(int32_t) != sizeof(OrthancPluginImageFormat) ||
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1510 sizeof(int32_t) != sizeof(OrthancPluginValueRepresentation) ||
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1511 sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFormat) ||
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1512 sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFlags) ||
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1513 sizeof(int32_t) != sizeof(OrthancPluginCreateDicomFlags) ||
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1514 sizeof(int32_t) != sizeof(OrthancPluginIdentifierConstraint) ||
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1515 sizeof(int32_t) != sizeof(OrthancPluginInstanceOrigin) ||
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1516 sizeof(int32_t) != sizeof(OrthancPluginJobStepStatus))
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1517 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1518 /* Mismatch in the size of the enumerations */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1519 return 0;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1520 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1521
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1522 /* Assume compatibility with the mainline */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1523 if (!strcmp(context->orthancVersion, "mainline"))
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1524 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1525 return 1;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1526 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1527
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1528 /* Parse the version of the Orthanc core */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1529 if (
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1530 #ifdef _MSC_VER
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1531 sscanf_s
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1532 #else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1533 sscanf
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1534 #endif
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1535 (context->orthancVersion, "%4d.%4d.%4d", &major, &minor, &revision) != 3)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1536 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1537 return 0;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1538 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1539
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1540 /* Check the major number of the version */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1541
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1542 if (major > expectedMajor)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1543 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1544 return 1;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1545 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1546
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1547 if (major < expectedMajor)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1548 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1549 return 0;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1550 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1551
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1552 /* Check the minor number of the version */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1553
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1554 if (minor > expectedMinor)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1555 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1556 return 1;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1557 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1558
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1559 if (minor < expectedMinor)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1560 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1561 return 0;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1562 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1563
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1564 /* Check the revision number of the version */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1565
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1566 if (revision >= expectedRevision)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1567 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1568 return 1;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1569 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1570 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1571 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1572 return 0;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1573 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1574 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1575
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1576
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1577 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1578 * @brief Check the compatibility of the plugin wrt. the version of its hosting Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1579 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1580 * This function checks whether the version of the Orthanc server
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1581 * running this plugin, is above the version of the current Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1582 * SDK header. This guarantees that the plugin is compatible with
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1583 * the hosting Orthanc (i.e. it will not call unavailable services).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1584 * The result of this function should always be checked in the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1585 * OrthancPluginInitialize() entry point of the plugin.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1586 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1587 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1588 * @return 1 if and only if the versions are compatible. If the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1589 * result is 0, the initialization of the plugin should fail.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1590 * @see OrthancPluginCheckVersionAdvanced
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1591 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1592 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1593 ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersion(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1594 OrthancPluginContext* context)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1595 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1596 return OrthancPluginCheckVersionAdvanced(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1597 context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1598 ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1599 ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1600 ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1601 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1602
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1603
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1604 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1605 * @brief Free a memory buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1606 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1607 * Free a memory buffer that was allocated by the core system of Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1608 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1609 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1610 * @param buffer The memory buffer to release.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1611 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1612 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeMemoryBuffer(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1613 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1614 OrthancPluginMemoryBuffer* buffer)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1615 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1616 context->Free(buffer->data);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1617 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1618
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1619
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1620 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1621 * @brief Log an error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1622 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1623 * Log an error message using the Orthanc logging system.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1624 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1625 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1626 * @param message The message to be logged.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1627 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1628 ORTHANC_PLUGIN_INLINE void OrthancPluginLogError(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1629 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1630 const char* message)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1631 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1632 context->InvokeService(context, _OrthancPluginService_LogError, message);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1633 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1634
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1635
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1636 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1637 * @brief Log a warning.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1638 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1639 * Log a warning message using the Orthanc logging system.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1640 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1641 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1642 * @param message The message to be logged.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1643 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1644 ORTHANC_PLUGIN_INLINE void OrthancPluginLogWarning(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1645 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1646 const char* message)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1647 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1648 context->InvokeService(context, _OrthancPluginService_LogWarning, message);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1649 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1650
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1651
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1652 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1653 * @brief Log an information.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1654 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1655 * Log an information message using the Orthanc logging system.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1656 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1657 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1658 * @param message The message to be logged.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1659 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1660 ORTHANC_PLUGIN_INLINE void OrthancPluginLogInfo(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1661 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1662 const char* message)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1663 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1664 context->InvokeService(context, _OrthancPluginService_LogInfo, message);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1665 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1666
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1667
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1668
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1669 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1670 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1671 const char* pathRegularExpression;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1672 OrthancPluginRestCallback callback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1673 } _OrthancPluginRestCallback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1674
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1675 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1676 * @brief Register a REST callback.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1677 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1678 * This function registers a REST callback against a regular
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1679 * expression for a URI. This function must be called during the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1680 * initialization of the plugin, i.e. inside the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1681 * OrthancPluginInitialize() public function.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1682 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1683 * Each REST callback is guaranteed to run in mutual exclusion.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1684 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1685 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1686 * @param pathRegularExpression Regular expression for the URI. May contain groups.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1687 * @param callback The callback function to handle the REST call.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1688 * @see OrthancPluginRegisterRestCallbackNoLock()
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1689 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1690 * @note
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1691 * The regular expression is case sensitive and must follow the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1692 * [Perl syntax](https://www.boost.org/doc/libs/1_67_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1693 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1694 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1695 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1696 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallback(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1697 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1698 const char* pathRegularExpression,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1699 OrthancPluginRestCallback callback)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1700 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1701 _OrthancPluginRestCallback params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1702 params.pathRegularExpression = pathRegularExpression;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1703 params.callback = callback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1704 context->InvokeService(context, _OrthancPluginService_RegisterRestCallback, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1705 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1706
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1707
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1708
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1709 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1710 * @brief Register a REST callback, without locking.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1711 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1712 * This function registers a REST callback against a regular
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1713 * expression for a URI. This function must be called during the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1714 * initialization of the plugin, i.e. inside the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1715 * OrthancPluginInitialize() public function.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1716 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1717 * Contrarily to OrthancPluginRegisterRestCallback(), the callback
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1718 * will NOT be invoked in mutual exclusion. This can be useful for
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1719 * high-performance plugins that must handle concurrent requests
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1720 * (Orthanc uses a pool of threads, one thread being assigned to
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1721 * each incoming HTTP request). Of course, if using this function,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1722 * it is up to the plugin to implement the required locking
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1723 * mechanisms.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1724 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1725 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1726 * @param pathRegularExpression Regular expression for the URI. May contain groups.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1727 * @param callback The callback function to handle the REST call.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1728 * @see OrthancPluginRegisterRestCallback()
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1729 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1730 * @note
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1731 * The regular expression is case sensitive and must follow the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1732 * [Perl syntax](https://www.boost.org/doc/libs/1_67_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1733 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1734 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1735 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1736 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallbackNoLock(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1737 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1738 const char* pathRegularExpression,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1739 OrthancPluginRestCallback callback)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1740 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1741 _OrthancPluginRestCallback params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1742 params.pathRegularExpression = pathRegularExpression;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1743 params.callback = callback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1744 context->InvokeService(context, _OrthancPluginService_RegisterRestCallbackNoLock, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1745 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1746
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1747
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1748
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1749 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1750 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1751 OrthancPluginOnStoredInstanceCallback callback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1752 } _OrthancPluginOnStoredInstanceCallback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1753
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1754 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1755 * @brief Register a callback for received instances.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1756 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1757 * This function registers a callback function that is called
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1758 * whenever a new DICOM instance is stored into the Orthanc core.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1759 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1760 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1761 * @param callback The callback function.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1762 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1763 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1764 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnStoredInstanceCallback(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1765 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1766 OrthancPluginOnStoredInstanceCallback callback)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1767 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1768 _OrthancPluginOnStoredInstanceCallback params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1769 params.callback = callback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1770
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1771 context->InvokeService(context, _OrthancPluginService_RegisterOnStoredInstanceCallback, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1772 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1773
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1774
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1775
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1776 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1777 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1778 OrthancPluginRestOutput* output;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1779 const char* answer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1780 uint32_t answerSize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1781 const char* mimeType;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1782 } _OrthancPluginAnswerBuffer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1783
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1784 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1785 * @brief Answer to a REST request.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1786 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1787 * This function answers to a REST request with the content of a memory buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1788 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1789 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1790 * @param output The HTTP connection to the client application.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1791 * @param answer Pointer to the memory buffer containing the answer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1792 * @param answerSize Number of bytes of the answer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1793 * @param mimeType The MIME type of the answer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1794 * @ingroup REST
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1795 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1796 ORTHANC_PLUGIN_INLINE void OrthancPluginAnswerBuffer(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1797 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1798 OrthancPluginRestOutput* output,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1799 const char* answer,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1800 uint32_t answerSize,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1801 const char* mimeType)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1802 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1803 _OrthancPluginAnswerBuffer params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1804 params.output = output;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1805 params.answer = answer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1806 params.answerSize = answerSize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1807 params.mimeType = mimeType;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1808 context->InvokeService(context, _OrthancPluginService_AnswerBuffer, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1809 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1810
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1811
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1812 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1813 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1814 OrthancPluginRestOutput* output;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1815 OrthancPluginPixelFormat format;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1816 uint32_t width;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1817 uint32_t height;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1818 uint32_t pitch;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1819 const void* buffer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1820 } _OrthancPluginCompressAndAnswerPngImage;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1821
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1822 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1823 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1824 OrthancPluginRestOutput* output;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1825 OrthancPluginImageFormat imageFormat;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1826 OrthancPluginPixelFormat pixelFormat;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1827 uint32_t width;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1828 uint32_t height;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1829 uint32_t pitch;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1830 const void* buffer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1831 uint8_t quality;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1832 } _OrthancPluginCompressAndAnswerImage;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1833
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1834
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1835 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1836 * @brief Answer to a REST request with a PNG image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1837 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1838 * This function answers to a REST request with a PNG image. The
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1839 * parameters of this function describe a memory buffer that
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1840 * contains an uncompressed image. The image will be automatically compressed
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1841 * as a PNG image by the core system of Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1842 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1843 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1844 * @param output The HTTP connection to the client application.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1845 * @param format The memory layout of the uncompressed image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1846 * @param width The width of the image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1847 * @param height The height of the image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1848 * @param pitch The pitch of the image (i.e. the number of bytes
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1849 * between 2 successive lines of the image in the memory buffer).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1850 * @param buffer The memory buffer containing the uncompressed image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1851 * @ingroup REST
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1852 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1853 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerPngImage(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1854 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1855 OrthancPluginRestOutput* output,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1856 OrthancPluginPixelFormat format,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1857 uint32_t width,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1858 uint32_t height,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1859 uint32_t pitch,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1860 const void* buffer)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1861 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1862 _OrthancPluginCompressAndAnswerImage params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1863 params.output = output;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1864 params.imageFormat = OrthancPluginImageFormat_Png;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1865 params.pixelFormat = format;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1866 params.width = width;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1867 params.height = height;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1868 params.pitch = pitch;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1869 params.buffer = buffer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1870 params.quality = 0; /* No quality for PNG */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1871 context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1872 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1873
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1874
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1875
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1876 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1877 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1878 OrthancPluginMemoryBuffer* target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1879 const char* instanceId;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1880 } _OrthancPluginGetDicomForInstance;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1881
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1882 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1883 * @brief Retrieve a DICOM instance using its Orthanc identifier.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1884 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1885 * Retrieve a DICOM instance using its Orthanc identifier. The DICOM
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1886 * file is stored into a newly allocated memory buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1887 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1888 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1889 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1890 * @param instanceId The Orthanc identifier of the DICOM instance of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1891 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1892 * @ingroup Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1893 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1894 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetDicomForInstance(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1895 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1896 OrthancPluginMemoryBuffer* target,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1897 const char* instanceId)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1898 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1899 _OrthancPluginGetDicomForInstance params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1900 params.target = target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1901 params.instanceId = instanceId;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1902 return context->InvokeService(context, _OrthancPluginService_GetDicomForInstance, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1903 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1904
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1905
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1906
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1907 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1908 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1909 OrthancPluginMemoryBuffer* target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1910 const char* uri;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1911 } _OrthancPluginRestApiGet;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1912
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1913 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1914 * @brief Make a GET call to the built-in Orthanc REST API.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1915 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1916 * Make a GET call to the built-in Orthanc REST API. The result to
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1917 * the query is stored into a newly allocated memory buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1918 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1919 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1920 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1921 * @param uri The URI in the built-in Orthanc API.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1922 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1923 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1924 * @see OrthancPluginRestApiGetAfterPlugins
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1925 * @ingroup Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1926 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1927 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1928 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1929 OrthancPluginMemoryBuffer* target,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1930 const char* uri)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1931 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1932 _OrthancPluginRestApiGet params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1933 params.target = target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1934 params.uri = uri;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1935 return context->InvokeService(context, _OrthancPluginService_RestApiGet, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1936 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1937
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1938
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1939
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1940 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1941 * @brief Make a GET call to the REST API, as tainted by the plugins.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1942 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1943 * Make a GET call to the Orthanc REST API, after all the plugins
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1944 * are applied. In other words, if some plugin overrides or adds the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1945 * called URI to the built-in Orthanc REST API, this call will
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1946 * return the result provided by this plugin. The result to the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1947 * query is stored into a newly allocated memory buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1948 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1949 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1950 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1951 * @param uri The URI in the built-in Orthanc API.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1952 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1953 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1954 * @see OrthancPluginRestApiGet
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1955 * @ingroup Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1956 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1957 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGetAfterPlugins(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1958 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1959 OrthancPluginMemoryBuffer* target,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1960 const char* uri)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1961 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1962 _OrthancPluginRestApiGet params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1963 params.target = target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1964 params.uri = uri;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1965 return context->InvokeService(context, _OrthancPluginService_RestApiGetAfterPlugins, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1966 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1967
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1968
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1969
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1970 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1971 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1972 OrthancPluginMemoryBuffer* target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1973 const char* uri;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1974 const char* body;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1975 uint32_t bodySize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1976 } _OrthancPluginRestApiPostPut;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1977
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1978 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1979 * @brief Make a POST call to the built-in Orthanc REST API.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1980 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1981 * Make a POST call to the built-in Orthanc REST API. The result to
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1982 * the query is stored into a newly allocated memory buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1983 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1984 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1985 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1986 * @param uri The URI in the built-in Orthanc API.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1987 * @param body The body of the POST request.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1988 * @param bodySize The size of the body.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1989 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1990 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1991 * @see OrthancPluginRestApiPostAfterPlugins
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1992 * @ingroup Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1993 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1994 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPost(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1995 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1996 OrthancPluginMemoryBuffer* target,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1997 const char* uri,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1998 const char* body,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
1999 uint32_t bodySize)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2000 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2001 _OrthancPluginRestApiPostPut params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2002 params.target = target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2003 params.uri = uri;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2004 params.body = body;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2005 params.bodySize = bodySize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2006 return context->InvokeService(context, _OrthancPluginService_RestApiPost, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2007 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2008
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2009
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2010 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2011 * @brief Make a POST call to the REST API, as tainted by the plugins.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2012 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2013 * Make a POST call to the Orthanc REST API, after all the plugins
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2014 * are applied. In other words, if some plugin overrides or adds the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2015 * called URI to the built-in Orthanc REST API, this call will
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2016 * return the result provided by this plugin. The result to the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2017 * query is stored into a newly allocated memory buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2018 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2019 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2020 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2021 * @param uri The URI in the built-in Orthanc API.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2022 * @param body The body of the POST request.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2023 * @param bodySize The size of the body.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2024 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2025 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2026 * @see OrthancPluginRestApiPost
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2027 * @ingroup Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2028 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2029 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPostAfterPlugins(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2030 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2031 OrthancPluginMemoryBuffer* target,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2032 const char* uri,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2033 const char* body,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2034 uint32_t bodySize)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2035 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2036 _OrthancPluginRestApiPostPut params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2037 params.target = target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2038 params.uri = uri;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2039 params.body = body;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2040 params.bodySize = bodySize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2041 return context->InvokeService(context, _OrthancPluginService_RestApiPostAfterPlugins, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2042 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2043
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2044
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2045
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2046 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2047 * @brief Make a DELETE call to the built-in Orthanc REST API.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2048 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2049 * Make a DELETE call to the built-in Orthanc REST API.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2050 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2051 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2052 * @param uri The URI to delete in the built-in Orthanc API.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2053 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2054 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2055 * @see OrthancPluginRestApiDeleteAfterPlugins
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2056 * @ingroup Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2057 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2058 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDelete(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2059 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2060 const char* uri)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2061 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2062 return context->InvokeService(context, _OrthancPluginService_RestApiDelete, uri);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2063 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2064
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2065
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2066 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2067 * @brief Make a DELETE call to the REST API, as tainted by the plugins.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2068 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2069 * Make a DELETE call to the Orthanc REST API, after all the plugins
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2070 * are applied. In other words, if some plugin overrides or adds the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2071 * called URI to the built-in Orthanc REST API, this call will
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2072 * return the result provided by this plugin.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2073 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2074 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2075 * @param uri The URI to delete in the built-in Orthanc API.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2076 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2077 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2078 * @see OrthancPluginRestApiDelete
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2079 * @ingroup Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2080 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2081 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDeleteAfterPlugins(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2082 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2083 const char* uri)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2084 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2085 return context->InvokeService(context, _OrthancPluginService_RestApiDeleteAfterPlugins, uri);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2086 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2087
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2088
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2089
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2090 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2091 * @brief Make a PUT call to the built-in Orthanc REST API.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2092 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2093 * Make a PUT call to the built-in Orthanc REST API. The result to
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2094 * the query is stored into a newly allocated memory buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2095 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2096 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2097 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2098 * @param uri The URI in the built-in Orthanc API.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2099 * @param body The body of the PUT request.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2100 * @param bodySize The size of the body.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2101 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2102 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2103 * @see OrthancPluginRestApiPutAfterPlugins
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2104 * @ingroup Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2105 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2106 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPut(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2107 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2108 OrthancPluginMemoryBuffer* target,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2109 const char* uri,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2110 const char* body,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2111 uint32_t bodySize)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2112 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2113 _OrthancPluginRestApiPostPut params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2114 params.target = target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2115 params.uri = uri;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2116 params.body = body;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2117 params.bodySize = bodySize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2118 return context->InvokeService(context, _OrthancPluginService_RestApiPut, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2119 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2120
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2121
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2122
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2123 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2124 * @brief Make a PUT call to the REST API, as tainted by the plugins.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2125 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2126 * Make a PUT call to the Orthanc REST API, after all the plugins
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2127 * are applied. In other words, if some plugin overrides or adds the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2128 * called URI to the built-in Orthanc REST API, this call will
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2129 * return the result provided by this plugin. The result to the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2130 * query is stored into a newly allocated memory buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2131 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2132 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2133 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2134 * @param uri The URI in the built-in Orthanc API.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2135 * @param body The body of the PUT request.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2136 * @param bodySize The size of the body.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2137 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2138 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2139 * @see OrthancPluginRestApiPut
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2140 * @ingroup Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2141 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2142 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPutAfterPlugins(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2143 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2144 OrthancPluginMemoryBuffer* target,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2145 const char* uri,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2146 const char* body,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2147 uint32_t bodySize)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2148 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2149 _OrthancPluginRestApiPostPut params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2150 params.target = target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2151 params.uri = uri;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2152 params.body = body;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2153 params.bodySize = bodySize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2154 return context->InvokeService(context, _OrthancPluginService_RestApiPutAfterPlugins, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2155 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2156
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2157
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2158
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2159 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2160 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2161 OrthancPluginRestOutput* output;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2162 const char* argument;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2163 } _OrthancPluginOutputPlusArgument;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2164
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2165 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2166 * @brief Redirect a REST request.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2167 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2168 * This function answers to a REST request by redirecting the user
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2169 * to another URI using HTTP status 301.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2170 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2171 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2172 * @param output The HTTP connection to the client application.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2173 * @param redirection Where to redirect.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2174 * @ingroup REST
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2175 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2176 ORTHANC_PLUGIN_INLINE void OrthancPluginRedirect(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2177 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2178 OrthancPluginRestOutput* output,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2179 const char* redirection)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2180 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2181 _OrthancPluginOutputPlusArgument params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2182 params.output = output;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2183 params.argument = redirection;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2184 context->InvokeService(context, _OrthancPluginService_Redirect, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2185 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2186
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2187
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2188
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2189 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2190 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2191 char** result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2192 const char* argument;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2193 } _OrthancPluginRetrieveDynamicString;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2194
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2195 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2196 * @brief Look for a patient.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2197 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2198 * Look for a patient stored in Orthanc, using its Patient ID tag (0x0010, 0x0020).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2199 * This function uses the database index to run as fast as possible (it does not loop
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2200 * over all the stored patients).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2201 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2202 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2203 * @param patientID The Patient ID of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2204 * @return The NULL value if the patient is non-existent, or a string containing the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2205 * Orthanc ID of the patient. This string must be freed by OrthancPluginFreeString().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2206 * @ingroup Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2207 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2208 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupPatient(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2209 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2210 const char* patientID)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2211 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2212 char* result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2213
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2214 _OrthancPluginRetrieveDynamicString params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2215 params.result = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2216 params.argument = patientID;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2217
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2218 if (context->InvokeService(context, _OrthancPluginService_LookupPatient, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2219 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2220 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2221 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2222 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2223 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2224 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2225 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2226 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2227 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2228
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2229
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2230 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2231 * @brief Look for a study.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2232 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2233 * Look for a study stored in Orthanc, using its Study Instance UID tag (0x0020, 0x000d).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2234 * This function uses the database index to run as fast as possible (it does not loop
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2235 * over all the stored studies).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2236 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2237 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2238 * @param studyUID The Study Instance UID of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2239 * @return The NULL value if the study is non-existent, or a string containing the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2240 * Orthanc ID of the study. This string must be freed by OrthancPluginFreeString().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2241 * @ingroup Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2242 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2243 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudy(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2244 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2245 const char* studyUID)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2246 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2247 char* result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2248
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2249 _OrthancPluginRetrieveDynamicString params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2250 params.result = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2251 params.argument = studyUID;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2252
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2253 if (context->InvokeService(context, _OrthancPluginService_LookupStudy, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2254 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2255 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2256 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2257 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2258 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2259 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2260 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2261 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2262 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2263
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2264
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2265 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2266 * @brief Look for a study, using the accession number.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2267 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2268 * Look for a study stored in Orthanc, using its Accession Number tag (0x0008, 0x0050).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2269 * This function uses the database index to run as fast as possible (it does not loop
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2270 * over all the stored studies).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2271 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2272 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2273 * @param accessionNumber The Accession Number of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2274 * @return The NULL value if the study is non-existent, or a string containing the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2275 * Orthanc ID of the study. This string must be freed by OrthancPluginFreeString().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2276 * @ingroup Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2277 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2278 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudyWithAccessionNumber(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2279 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2280 const char* accessionNumber)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2281 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2282 char* result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2283
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2284 _OrthancPluginRetrieveDynamicString params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2285 params.result = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2286 params.argument = accessionNumber;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2287
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2288 if (context->InvokeService(context, _OrthancPluginService_LookupStudyWithAccessionNumber, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2289 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2290 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2291 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2292 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2293 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2294 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2295 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2296 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2297 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2298
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2299
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2300 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2301 * @brief Look for a series.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2302 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2303 * Look for a series stored in Orthanc, using its Series Instance UID tag (0x0020, 0x000e).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2304 * This function uses the database index to run as fast as possible (it does not loop
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2305 * over all the stored series).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2306 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2307 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2308 * @param seriesUID The Series Instance UID of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2309 * @return The NULL value if the series is non-existent, or a string containing the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2310 * Orthanc ID of the series. This string must be freed by OrthancPluginFreeString().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2311 * @ingroup Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2312 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2313 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupSeries(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2314 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2315 const char* seriesUID)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2316 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2317 char* result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2318
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2319 _OrthancPluginRetrieveDynamicString params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2320 params.result = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2321 params.argument = seriesUID;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2322
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2323 if (context->InvokeService(context, _OrthancPluginService_LookupSeries, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2324 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2325 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2326 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2327 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2328 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2329 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2330 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2331 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2332 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2333
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2334
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2335 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2336 * @brief Look for an instance.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2337 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2338 * Look for an instance stored in Orthanc, using its SOP Instance UID tag (0x0008, 0x0018).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2339 * This function uses the database index to run as fast as possible (it does not loop
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2340 * over all the stored instances).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2341 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2342 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2343 * @param sopInstanceUID The SOP Instance UID of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2344 * @return The NULL value if the instance is non-existent, or a string containing the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2345 * Orthanc ID of the instance. This string must be freed by OrthancPluginFreeString().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2346 * @ingroup Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2347 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2348 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupInstance(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2349 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2350 const char* sopInstanceUID)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2351 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2352 char* result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2353
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2354 _OrthancPluginRetrieveDynamicString params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2355 params.result = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2356 params.argument = sopInstanceUID;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2357
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2358 if (context->InvokeService(context, _OrthancPluginService_LookupInstance, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2359 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2360 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2361 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2362 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2363 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2364 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2365 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2366 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2367 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2368
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2369
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2370
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2371 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2372 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2373 OrthancPluginRestOutput* output;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2374 uint16_t status;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2375 } _OrthancPluginSendHttpStatusCode;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2376
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2377 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2378 * @brief Send a HTTP status code.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2379 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2380 * This function answers to a REST request by sending a HTTP status
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2381 * code (such as "400 - Bad Request"). Note that:
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2382 * - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2383 * - Redirections (status 301) must use ::OrthancPluginRedirect().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2384 * - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2385 * - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2386 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2387 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2388 * @param output The HTTP connection to the client application.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2389 * @param status The HTTP status code to be sent.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2390 * @ingroup REST
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2391 * @see OrthancPluginSendHttpStatus()
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2392 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2393 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatusCode(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2394 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2395 OrthancPluginRestOutput* output,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2396 uint16_t status)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2397 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2398 _OrthancPluginSendHttpStatusCode params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2399 params.output = output;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2400 params.status = status;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2401 context->InvokeService(context, _OrthancPluginService_SendHttpStatusCode, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2402 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2403
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2404
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2405 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2406 * @brief Signal that a REST request is not authorized.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2407 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2408 * This function answers to a REST request by signaling that it is
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2409 * not authorized.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2410 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2411 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2412 * @param output The HTTP connection to the client application.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2413 * @param realm The realm for the authorization process.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2414 * @ingroup REST
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2415 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2416 ORTHANC_PLUGIN_INLINE void OrthancPluginSendUnauthorized(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2417 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2418 OrthancPluginRestOutput* output,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2419 const char* realm)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2420 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2421 _OrthancPluginOutputPlusArgument params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2422 params.output = output;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2423 params.argument = realm;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2424 context->InvokeService(context, _OrthancPluginService_SendUnauthorized, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2425 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2426
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2427
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2428 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2429 * @brief Signal that this URI does not support this HTTP method.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2430 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2431 * This function answers to a REST request by signaling that the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2432 * queried URI does not support this method.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2433 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2434 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2435 * @param output The HTTP connection to the client application.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2436 * @param allowedMethods The allowed methods for this URI (e.g. "GET,POST" after a PUT or a POST request).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2437 * @ingroup REST
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2438 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2439 ORTHANC_PLUGIN_INLINE void OrthancPluginSendMethodNotAllowed(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2440 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2441 OrthancPluginRestOutput* output,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2442 const char* allowedMethods)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2443 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2444 _OrthancPluginOutputPlusArgument params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2445 params.output = output;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2446 params.argument = allowedMethods;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2447 context->InvokeService(context, _OrthancPluginService_SendMethodNotAllowed, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2448 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2449
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2450
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2451 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2452 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2453 OrthancPluginRestOutput* output;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2454 const char* key;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2455 const char* value;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2456 } _OrthancPluginSetHttpHeader;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2457
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2458 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2459 * @brief Set a cookie.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2460 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2461 * This function sets a cookie in the HTTP client.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2462 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2463 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2464 * @param output The HTTP connection to the client application.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2465 * @param cookie The cookie to be set.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2466 * @param value The value of the cookie.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2467 * @ingroup REST
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2468 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2469 ORTHANC_PLUGIN_INLINE void OrthancPluginSetCookie(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2470 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2471 OrthancPluginRestOutput* output,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2472 const char* cookie,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2473 const char* value)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2474 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2475 _OrthancPluginSetHttpHeader params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2476 params.output = output;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2477 params.key = cookie;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2478 params.value = value;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2479 context->InvokeService(context, _OrthancPluginService_SetCookie, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2480 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2481
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2482
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2483 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2484 * @brief Set some HTTP header.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2485 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2486 * This function sets a HTTP header in the HTTP answer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2487 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2488 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2489 * @param output The HTTP connection to the client application.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2490 * @param key The HTTP header to be set.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2491 * @param value The value of the HTTP header.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2492 * @ingroup REST
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2493 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2494 ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpHeader(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2495 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2496 OrthancPluginRestOutput* output,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2497 const char* key,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2498 const char* value)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2499 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2500 _OrthancPluginSetHttpHeader params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2501 params.output = output;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2502 params.key = key;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2503 params.value = value;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2504 context->InvokeService(context, _OrthancPluginService_SetHttpHeader, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2505 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2506
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2507
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2508 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2509 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2510 char** resultStringToFree;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2511 const char** resultString;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2512 int64_t* resultInt64;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2513 const char* key;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2514 OrthancPluginDicomInstance* instance;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2515 OrthancPluginInstanceOrigin* resultOrigin; /* New in Orthanc 0.9.5 SDK */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2516 } _OrthancPluginAccessDicomInstance;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2517
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2518
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2519 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2520 * @brief Get the AET of a DICOM instance.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2521 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2522 * This function returns the Application Entity Title (AET) of the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2523 * DICOM modality from which a DICOM instance originates.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2524 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2525 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2526 * @param instance The instance of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2527 * @return The AET if success, NULL if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2528 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2529 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2530 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceRemoteAet(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2531 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2532 OrthancPluginDicomInstance* instance)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2533 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2534 const char* result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2535
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2536 _OrthancPluginAccessDicomInstance params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2537 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2538 params.resultString = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2539 params.instance = instance;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2540
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2541 if (context->InvokeService(context, _OrthancPluginService_GetInstanceRemoteAet, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2542 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2543 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2544 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2545 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2546 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2547 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2548 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2549 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2550 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2551
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2552
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2553 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2554 * @brief Get the size of a DICOM file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2555 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2556 * This function returns the number of bytes of the given DICOM instance.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2557 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2558 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2559 * @param instance The instance of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2560 * @return The size of the file, -1 in case of error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2561 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2562 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2563 ORTHANC_PLUGIN_INLINE int64_t OrthancPluginGetInstanceSize(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2564 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2565 OrthancPluginDicomInstance* instance)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2566 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2567 int64_t size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2568
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2569 _OrthancPluginAccessDicomInstance params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2570 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2571 params.resultInt64 = &size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2572 params.instance = instance;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2573
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2574 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSize, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2575 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2576 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2577 return -1;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2578 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2579 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2580 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2581 return size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2582 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2583 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2584
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2585
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2586 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2587 * @brief Get the data of a DICOM file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2588 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2589 * This function returns a pointer to the content of the given DICOM instance.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2590 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2591 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2592 * @param instance The instance of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2593 * @return The pointer to the DICOM data, NULL in case of error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2594 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2595 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2596 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceData(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2597 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2598 OrthancPluginDicomInstance* instance)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2599 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2600 const char* result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2601
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2602 _OrthancPluginAccessDicomInstance params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2603 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2604 params.resultString = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2605 params.instance = instance;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2606
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2607 if (context->InvokeService(context, _OrthancPluginService_GetInstanceData, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2608 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2609 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2610 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2611 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2612 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2613 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2614 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2615 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2616 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2617
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2618
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2619 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2620 * @brief Get the DICOM tag hierarchy as a JSON file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2621 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2622 * This function returns a pointer to a newly created string
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2623 * containing a JSON file. This JSON file encodes the tag hierarchy
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2624 * of the given DICOM instance.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2625 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2626 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2627 * @param instance The instance of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2628 * @return The NULL value in case of error, or a string containing the JSON file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2629 * This string must be freed by OrthancPluginFreeString().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2630 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2631 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2632 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceJson(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2633 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2634 OrthancPluginDicomInstance* instance)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2635 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2636 char* result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2637
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2638 _OrthancPluginAccessDicomInstance params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2639 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2640 params.resultStringToFree = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2641 params.instance = instance;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2642
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2643 if (context->InvokeService(context, _OrthancPluginService_GetInstanceJson, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2644 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2645 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2646 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2647 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2648 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2649 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2650 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2651 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2652 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2653
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2654
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2655 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2656 * @brief Get the DICOM tag hierarchy as a JSON file (with simplification).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2657 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2658 * This function returns a pointer to a newly created string
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2659 * containing a JSON file. This JSON file encodes the tag hierarchy
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2660 * of the given DICOM instance. In contrast with
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2661 * ::OrthancPluginGetInstanceJson(), the returned JSON file is in
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2662 * its simplified version.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2663 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2664 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2665 * @param instance The instance of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2666 * @return The NULL value in case of error, or a string containing the JSON file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2667 * This string must be freed by OrthancPluginFreeString().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2668 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2669 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2670 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceSimplifiedJson(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2671 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2672 OrthancPluginDicomInstance* instance)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2673 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2674 char* result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2675
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2676 _OrthancPluginAccessDicomInstance params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2677 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2678 params.resultStringToFree = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2679 params.instance = instance;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2680
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2681 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSimplifiedJson, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2682 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2683 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2684 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2685 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2686 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2687 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2688 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2689 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2690 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2691
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2692
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2693 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2694 * @brief Check whether a DICOM instance is associated with some metadata.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2695 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2696 * This function checks whether the DICOM instance of interest is
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2697 * associated with some metadata. As of Orthanc 0.8.1, in the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2698 * callbacks registered by
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2699 * ::OrthancPluginRegisterOnStoredInstanceCallback(), the only
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2700 * possibly available metadata are "ReceptionDate", "RemoteAET" and
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2701 * "IndexInSeries".
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2702 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2703 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2704 * @param instance The instance of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2705 * @param metadata The metadata of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2706 * @return 1 if the metadata is present, 0 if it is absent, -1 in case of error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2707 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2708 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2709 ORTHANC_PLUGIN_INLINE int OrthancPluginHasInstanceMetadata(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2710 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2711 OrthancPluginDicomInstance* instance,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2712 const char* metadata)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2713 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2714 int64_t result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2715
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2716 _OrthancPluginAccessDicomInstance params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2717 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2718 params.resultInt64 = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2719 params.instance = instance;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2720 params.key = metadata;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2721
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2722 if (context->InvokeService(context, _OrthancPluginService_HasInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2723 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2724 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2725 return -1;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2726 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2727 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2728 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2729 return (result != 0);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2730 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2731 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2732
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2733
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2734 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2735 * @brief Get the value of some metadata associated with a given DICOM instance.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2736 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2737 * This functions returns the value of some metadata that is associated with the DICOM instance of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2738 * Before calling this function, the existence of the metadata must have been checked with
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2739 * ::OrthancPluginHasInstanceMetadata().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2740 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2741 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2742 * @param instance The instance of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2743 * @param metadata The metadata of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2744 * @return The metadata value if success, NULL if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2745 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2746 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2747 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceMetadata(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2748 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2749 OrthancPluginDicomInstance* instance,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2750 const char* metadata)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2751 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2752 const char* result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2753
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2754 _OrthancPluginAccessDicomInstance params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2755 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2756 params.resultString = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2757 params.instance = instance;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2758 params.key = metadata;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2759
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2760 if (context->InvokeService(context, _OrthancPluginService_GetInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2761 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2762 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2763 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2764 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2765 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2766 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2767 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2768 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2769 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2770
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2771
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2772
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2773 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2774 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2775 OrthancPluginStorageCreate create;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2776 OrthancPluginStorageRead read;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2777 OrthancPluginStorageRemove remove;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2778 OrthancPluginFree free;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2779 } _OrthancPluginRegisterStorageArea;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2780
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2781 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2782 * @brief Register a custom storage area.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2783 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2784 * This function registers a custom storage area, to replace the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2785 * built-in way Orthanc stores its files on the filesystem. This
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2786 * function must be called during the initialization of the plugin,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2787 * i.e. inside the OrthancPluginInitialize() public function.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2788 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2789 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2790 * @param create The callback function to store a file on the custom storage area.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2791 * @param read The callback function to read a file from the custom storage area.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2792 * @param remove The callback function to remove a file from the custom storage area.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2793 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2794 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2795 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterStorageArea(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2796 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2797 OrthancPluginStorageCreate create,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2798 OrthancPluginStorageRead read,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2799 OrthancPluginStorageRemove remove)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2800 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2801 _OrthancPluginRegisterStorageArea params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2802 params.create = create;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2803 params.read = read;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2804 params.remove = remove;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2805
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2806 #ifdef __cplusplus
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2807 params.free = ::free;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2808 #else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2809 params.free = free;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2810 #endif
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2811
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2812 context->InvokeService(context, _OrthancPluginService_RegisterStorageArea, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2813 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2814
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2815
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2816
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2817 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2818 * @brief Return the path to the Orthanc executable.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2819 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2820 * This function returns the path to the Orthanc executable.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2821 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2822 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2823 * @return NULL in the case of an error, or a newly allocated string
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2824 * containing the path. This string must be freed by
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2825 * OrthancPluginFreeString().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2826 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2827 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancPath(OrthancPluginContext* context)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2828 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2829 char* result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2830
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2831 _OrthancPluginRetrieveDynamicString params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2832 params.result = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2833 params.argument = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2834
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2835 if (context->InvokeService(context, _OrthancPluginService_GetOrthancPath, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2836 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2837 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2838 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2839 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2840 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2841 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2842 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2843 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2844 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2845
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2846
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2847 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2848 * @brief Return the directory containing the Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2849 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2850 * This function returns the path to the directory containing the Orthanc executable.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2851 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2852 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2853 * @return NULL in the case of an error, or a newly allocated string
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2854 * containing the path. This string must be freed by
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2855 * OrthancPluginFreeString().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2856 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2857 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancDirectory(OrthancPluginContext* context)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2858 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2859 char* result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2860
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2861 _OrthancPluginRetrieveDynamicString params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2862 params.result = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2863 params.argument = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2864
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2865 if (context->InvokeService(context, _OrthancPluginService_GetOrthancDirectory, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2866 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2867 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2868 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2869 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2870 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2871 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2872 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2873 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2874 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2875
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2876
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2877 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2878 * @brief Return the path to the configuration file(s).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2879 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2880 * This function returns the path to the configuration file(s) that
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2881 * was specified when starting Orthanc. Since version 0.9.1, this
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2882 * path can refer to a folder that stores a set of configuration
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2883 * files. This function is deprecated in favor of
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2884 * OrthancPluginGetConfiguration().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2885 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2886 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2887 * @return NULL in the case of an error, or a newly allocated string
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2888 * containing the path. This string must be freed by
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2889 * OrthancPluginFreeString().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2890 * @see OrthancPluginGetConfiguration()
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2891 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2892 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfigurationPath(OrthancPluginContext* context)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2893 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2894 char* result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2895
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2896 _OrthancPluginRetrieveDynamicString params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2897 params.result = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2898 params.argument = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2899
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2900 if (context->InvokeService(context, _OrthancPluginService_GetConfigurationPath, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2901 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2902 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2903 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2904 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2905 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2906 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2907 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2908 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2909 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2910
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2911
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2912
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2913 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2914 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2915 OrthancPluginOnChangeCallback callback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2916 } _OrthancPluginOnChangeCallback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2917
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2918 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2919 * @brief Register a callback to monitor changes.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2920 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2921 * This function registers a callback function that is called
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2922 * whenever a change happens to some DICOM resource.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2923 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2924 * @warning If your change callback has to call the REST API of
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2925 * Orthanc, you should make these calls in a separate thread (with
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2926 * the events passing through a message queue). Otherwise, this
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2927 * could result in deadlocks in the presence of other plugins or Lua
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2928 * scripts.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2929 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2930 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2931 * @param callback The callback function.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2932 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2933 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2934 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnChangeCallback(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2935 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2936 OrthancPluginOnChangeCallback callback)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2937 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2938 _OrthancPluginOnChangeCallback params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2939 params.callback = callback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2940
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2941 context->InvokeService(context, _OrthancPluginService_RegisterOnChangeCallback, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2942 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2943
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2944
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2945
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2946 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2947 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2948 const char* plugin;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2949 _OrthancPluginProperty property;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2950 const char* value;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2951 } _OrthancPluginSetPluginProperty;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2952
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2953
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2954 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2955 * @brief Set the URI where the plugin provides its Web interface.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2956 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2957 * For plugins that come with a Web interface, this function
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2958 * declares the entry path where to find this interface. This
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2959 * information is notably used in the "Plugins" page of Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2960 * Explorer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2961 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2962 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2963 * @param uri The root URI for this plugin.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2964 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2965 ORTHANC_PLUGIN_INLINE void OrthancPluginSetRootUri(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2966 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2967 const char* uri)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2968 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2969 _OrthancPluginSetPluginProperty params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2970 params.plugin = OrthancPluginGetName();
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2971 params.property = _OrthancPluginProperty_RootUri;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2972 params.value = uri;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2973
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2974 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2975 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2976
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2977
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2978 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2979 * @brief Set a description for this plugin.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2980 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2981 * Set a description for this plugin. It is displayed in the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2982 * "Plugins" page of Orthanc Explorer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2983 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2984 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2985 * @param description The description.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2986 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2987 ORTHANC_PLUGIN_INLINE void OrthancPluginSetDescription(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2988 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2989 const char* description)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2990 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2991 _OrthancPluginSetPluginProperty params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2992 params.plugin = OrthancPluginGetName();
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2993 params.property = _OrthancPluginProperty_Description;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2994 params.value = description;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2995
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2996 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2997 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2998
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
2999
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3000 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3001 * @brief Extend the JavaScript code of Orthanc Explorer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3002 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3003 * Add JavaScript code to customize the default behavior of Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3004 * Explorer. This can for instance be used to add new buttons.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3005 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3006 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3007 * @param javascript The custom JavaScript code.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3008 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3009 ORTHANC_PLUGIN_INLINE void OrthancPluginExtendOrthancExplorer(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3010 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3011 const char* javascript)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3012 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3013 _OrthancPluginSetPluginProperty params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3014 params.plugin = OrthancPluginGetName();
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3015 params.property = _OrthancPluginProperty_OrthancExplorer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3016 params.value = javascript;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3017
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3018 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3019 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3020
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3021
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3022 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3023 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3024 char** result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3025 int32_t property;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3026 const char* value;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3027 } _OrthancPluginGlobalProperty;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3028
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3029
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3030 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3031 * @brief Get the value of a global property.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3032 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3033 * Get the value of a global property that is stored in the Orthanc database. Global
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3034 * properties whose index is below 1024 are reserved by Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3035 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3036 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3037 * @param property The global property of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3038 * @param defaultValue The value to return, if the global property is unset.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3039 * @return The value of the global property, or NULL in the case of an error. This
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3040 * string must be freed by OrthancPluginFreeString().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3041 * @ingroup Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3042 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3043 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetGlobalProperty(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3044 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3045 int32_t property,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3046 const char* defaultValue)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3047 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3048 char* result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3049
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3050 _OrthancPluginGlobalProperty params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3051 params.result = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3052 params.property = property;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3053 params.value = defaultValue;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3054
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3055 if (context->InvokeService(context, _OrthancPluginService_GetGlobalProperty, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3056 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3057 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3058 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3059 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3060 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3061 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3062 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3063 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3064 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3065
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3066
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3067 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3068 * @brief Set the value of a global property.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3069 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3070 * Set the value of a global property into the Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3071 * database. Setting a global property can be used by plugins to
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3072 * save their internal parameters. Plugins are only allowed to set
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3073 * properties whose index are above or equal to 1024 (properties
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3074 * below 1024 are read-only and reserved by Orthanc).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3075 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3076 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3077 * @param property The global property of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3078 * @param value The value to be set in the global property.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3079 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3080 * @ingroup Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3081 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3082 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSetGlobalProperty(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3083 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3084 int32_t property,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3085 const char* value)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3086 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3087 _OrthancPluginGlobalProperty params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3088 params.result = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3089 params.property = property;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3090 params.value = value;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3091
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3092 return context->InvokeService(context, _OrthancPluginService_SetGlobalProperty, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3093 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3094
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3095
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3096
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3097 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3098 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3099 int32_t *resultInt32;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3100 uint32_t *resultUint32;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3101 int64_t *resultInt64;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3102 uint64_t *resultUint64;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3103 } _OrthancPluginReturnSingleValue;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3104
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3105 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3106 * @brief Get the number of command-line arguments.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3107 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3108 * Retrieve the number of command-line arguments that were used to launch Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3109 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3110 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3111 * @return The number of arguments.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3112 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3113 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetCommandLineArgumentsCount(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3114 OrthancPluginContext* context)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3115 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3116 uint32_t count = 0;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3117
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3118 _OrthancPluginReturnSingleValue params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3119 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3120 params.resultUint32 = &count;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3121
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3122 if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgumentsCount, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3123 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3124 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3125 return 0;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3126 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3127 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3128 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3129 return count;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3130 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3131 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3132
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3133
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3134
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3135 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3136 * @brief Get the value of a command-line argument.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3137 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3138 * Get the value of one of the command-line arguments that were used
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3139 * to launch Orthanc. The number of available arguments can be
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3140 * retrieved by OrthancPluginGetCommandLineArgumentsCount().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3141 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3142 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3143 * @param argument The index of the argument.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3144 * @return The value of the argument, or NULL in the case of an error. This
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3145 * string must be freed by OrthancPluginFreeString().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3146 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3147 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetCommandLineArgument(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3148 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3149 uint32_t argument)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3150 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3151 char* result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3152
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3153 _OrthancPluginGlobalProperty params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3154 params.result = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3155 params.property = (int32_t) argument;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3156 params.value = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3157
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3158 if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgument, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3159 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3160 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3161 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3162 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3163 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3164 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3165 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3166 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3167 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3168
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3169
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3170 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3171 * @brief Get the expected version of the database schema.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3172 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3173 * Retrieve the expected version of the database schema.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3174 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3175 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3176 * @return The version.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3177 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3178 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3179 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetExpectedDatabaseVersion(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3180 OrthancPluginContext* context)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3181 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3182 uint32_t count = 0;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3183
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3184 _OrthancPluginReturnSingleValue params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3185 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3186 params.resultUint32 = &count;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3187
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3188 if (context->InvokeService(context, _OrthancPluginService_GetExpectedDatabaseVersion, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3189 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3190 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3191 return 0;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3192 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3193 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3194 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3195 return count;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3196 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3197 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3198
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3199
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3200
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3201 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3202 * @brief Return the content of the configuration file(s).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3203 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3204 * This function returns the content of the configuration that is
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3205 * used by Orthanc, formatted as a JSON string.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3206 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3207 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3208 * @return NULL in the case of an error, or a newly allocated string
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3209 * containing the configuration. This string must be freed by
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3210 * OrthancPluginFreeString().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3211 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3212 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfiguration(OrthancPluginContext* context)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3213 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3214 char* result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3215
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3216 _OrthancPluginRetrieveDynamicString params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3217 params.result = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3218 params.argument = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3219
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3220 if (context->InvokeService(context, _OrthancPluginService_GetConfiguration, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3221 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3222 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3223 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3224 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3225 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3226 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3227 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3228 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3229 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3230
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3231
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3232
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3233 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3234 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3235 OrthancPluginRestOutput* output;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3236 const char* subType;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3237 const char* contentType;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3238 } _OrthancPluginStartMultipartAnswer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3239
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3240 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3241 * @brief Start an HTTP multipart answer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3242 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3243 * Initiates a HTTP multipart answer, as the result of a REST request.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3244 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3245 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3246 * @param output The HTTP connection to the client application.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3247 * @param subType The sub-type of the multipart answer ("mixed" or "related").
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3248 * @param contentType The MIME type of the items in the multipart answer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3249 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3250 * @see OrthancPluginSendMultipartItem(), OrthancPluginSendMultipartItem2()
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3251 * @ingroup REST
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3252 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3253 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStartMultipartAnswer(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3254 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3255 OrthancPluginRestOutput* output,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3256 const char* subType,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3257 const char* contentType)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3258 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3259 _OrthancPluginStartMultipartAnswer params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3260 params.output = output;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3261 params.subType = subType;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3262 params.contentType = contentType;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3263 return context->InvokeService(context, _OrthancPluginService_StartMultipartAnswer, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3264 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3265
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3266
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3267 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3268 * @brief Send an item as a part of some HTTP multipart answer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3269 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3270 * This function sends an item as a part of some HTTP multipart
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3271 * answer that was initiated by OrthancPluginStartMultipartAnswer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3272 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3273 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3274 * @param output The HTTP connection to the client application.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3275 * @param answer Pointer to the memory buffer containing the item.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3276 * @param answerSize Number of bytes of the item.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3277 * @return 0 if success, or the error code if failure (this notably happens
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3278 * if the connection is closed by the client).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3279 * @see OrthancPluginSendMultipartItem2()
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3280 * @ingroup REST
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3281 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3282 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3283 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3284 OrthancPluginRestOutput* output,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3285 const char* answer,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3286 uint32_t answerSize)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3287 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3288 _OrthancPluginAnswerBuffer params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3289 params.output = output;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3290 params.answer = answer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3291 params.answerSize = answerSize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3292 params.mimeType = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3293 return context->InvokeService(context, _OrthancPluginService_SendMultipartItem, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3294 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3295
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3296
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3297
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3298 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3299 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3300 OrthancPluginMemoryBuffer* target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3301 const void* source;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3302 uint32_t size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3303 OrthancPluginCompressionType compression;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3304 uint8_t uncompress;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3305 } _OrthancPluginBufferCompression;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3306
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3307
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3308 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3309 * @brief Compress or decompress a buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3310 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3311 * This function compresses or decompresses a buffer, using the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3312 * version of the zlib library that is used by the Orthanc core.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3313 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3314 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3315 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3316 * @param source The source buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3317 * @param size The size in bytes of the source buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3318 * @param compression The compression algorithm.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3319 * @param uncompress If set to "0", the buffer must be compressed.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3320 * If set to "1", the buffer must be uncompressed.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3321 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3322 * @ingroup Images
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3323 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3324 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginBufferCompression(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3325 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3326 OrthancPluginMemoryBuffer* target,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3327 const void* source,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3328 uint32_t size,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3329 OrthancPluginCompressionType compression,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3330 uint8_t uncompress)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3331 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3332 _OrthancPluginBufferCompression params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3333 params.target = target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3334 params.source = source;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3335 params.size = size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3336 params.compression = compression;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3337 params.uncompress = uncompress;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3338
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3339 return context->InvokeService(context, _OrthancPluginService_BufferCompression, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3340 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3341
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3342
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3343
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3344 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3345 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3346 OrthancPluginMemoryBuffer* target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3347 const char* path;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3348 } _OrthancPluginReadFile;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3349
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3350 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3351 * @brief Read a file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3352 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3353 * Read the content of a file on the filesystem, and returns it into
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3354 * a newly allocated memory buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3355 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3356 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3357 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3358 * @param path The path of the file to be read.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3359 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3360 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3361 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReadFile(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3362 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3363 OrthancPluginMemoryBuffer* target,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3364 const char* path)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3365 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3366 _OrthancPluginReadFile params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3367 params.target = target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3368 params.path = path;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3369 return context->InvokeService(context, _OrthancPluginService_ReadFile, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3370 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3371
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3372
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3373
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3374 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3375 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3376 const char* path;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3377 const void* data;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3378 uint32_t size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3379 } _OrthancPluginWriteFile;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3380
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3381 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3382 * @brief Write a file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3383 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3384 * Write the content of a memory buffer to the filesystem.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3385 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3386 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3387 * @param path The path of the file to be written.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3388 * @param data The content of the memory buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3389 * @param size The size of the memory buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3390 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3391 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3392 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWriteFile(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3393 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3394 const char* path,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3395 const void* data,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3396 uint32_t size)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3397 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3398 _OrthancPluginWriteFile params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3399 params.path = path;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3400 params.data = data;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3401 params.size = size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3402 return context->InvokeService(context, _OrthancPluginService_WriteFile, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3403 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3404
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3405
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3406
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3407 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3408 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3409 const char** target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3410 OrthancPluginErrorCode error;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3411 } _OrthancPluginGetErrorDescription;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3412
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3413 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3414 * @brief Get the description of a given error code.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3415 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3416 * This function returns the description of a given error code.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3417 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3418 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3419 * @param error The error code of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3420 * @return The error description. This is a statically-allocated
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3421 * string, do not free it.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3422 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3423 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetErrorDescription(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3424 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3425 OrthancPluginErrorCode error)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3426 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3427 const char* result = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3428
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3429 _OrthancPluginGetErrorDescription params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3430 params.target = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3431 params.error = error;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3432
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3433 if (context->InvokeService(context, _OrthancPluginService_GetErrorDescription, &params) != OrthancPluginErrorCode_Success ||
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3434 result == NULL)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3435 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3436 return "Unknown error code";
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3437 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3438 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3439 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3440 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3441 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3442 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3443
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3444
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3445
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3446 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3447 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3448 OrthancPluginRestOutput* output;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3449 uint16_t status;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3450 const char* body;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3451 uint32_t bodySize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3452 } _OrthancPluginSendHttpStatus;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3453
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3454 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3455 * @brief Send a HTTP status, with a custom body.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3456 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3457 * This function answers to a HTTP request by sending a HTTP status
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3458 * code (such as "400 - Bad Request"), together with a body
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3459 * describing the error. The body will only be returned if the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3460 * configuration option "HttpDescribeErrors" of Orthanc is set to "true".
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3461 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3462 * Note that:
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3463 * - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3464 * - Redirections (status 301) must use ::OrthancPluginRedirect().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3465 * - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3466 * - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3467 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3468 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3469 * @param output The HTTP connection to the client application.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3470 * @param status The HTTP status code to be sent.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3471 * @param body The body of the answer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3472 * @param bodySize The size of the body.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3473 * @see OrthancPluginSendHttpStatusCode()
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3474 * @ingroup REST
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3475 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3476 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatus(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3477 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3478 OrthancPluginRestOutput* output,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3479 uint16_t status,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3480 const char* body,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3481 uint32_t bodySize)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3482 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3483 _OrthancPluginSendHttpStatus params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3484 params.output = output;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3485 params.status = status;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3486 params.body = body;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3487 params.bodySize = bodySize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3488 context->InvokeService(context, _OrthancPluginService_SendHttpStatus, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3489 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3490
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3491
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3492
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3493 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3494 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3495 const OrthancPluginImage* image;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3496 uint32_t* resultUint32;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3497 OrthancPluginPixelFormat* resultPixelFormat;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3498 void** resultBuffer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3499 } _OrthancPluginGetImageInfo;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3500
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3501
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3502 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3503 * @brief Return the pixel format of an image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3504 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3505 * This function returns the type of memory layout for the pixels of the given image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3506 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3507 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3508 * @param image The image of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3509 * @return The pixel format.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3510 * @ingroup Images
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3511 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3512 ORTHANC_PLUGIN_INLINE OrthancPluginPixelFormat OrthancPluginGetImagePixelFormat(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3513 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3514 const OrthancPluginImage* image)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3515 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3516 OrthancPluginPixelFormat target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3517
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3518 _OrthancPluginGetImageInfo params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3519 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3520 params.image = image;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3521 params.resultPixelFormat = &target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3522
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3523 if (context->InvokeService(context, _OrthancPluginService_GetImagePixelFormat, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3524 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3525 return OrthancPluginPixelFormat_Unknown;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3526 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3527 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3528 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3529 return (OrthancPluginPixelFormat) target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3530 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3531 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3532
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3533
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3534
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3535 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3536 * @brief Return the width of an image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3537 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3538 * This function returns the width of the given image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3539 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3540 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3541 * @param image The image of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3542 * @return The width.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3543 * @ingroup Images
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3544 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3545 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageWidth(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3546 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3547 const OrthancPluginImage* image)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3548 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3549 uint32_t width;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3550
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3551 _OrthancPluginGetImageInfo params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3552 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3553 params.image = image;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3554 params.resultUint32 = &width;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3555
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3556 if (context->InvokeService(context, _OrthancPluginService_GetImageWidth, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3557 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3558 return 0;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3559 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3560 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3561 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3562 return width;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3563 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3564 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3565
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3566
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3567
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3568 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3569 * @brief Return the height of an image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3570 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3571 * This function returns the height of the given image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3572 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3573 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3574 * @param image The image of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3575 * @return The height.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3576 * @ingroup Images
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3577 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3578 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageHeight(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3579 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3580 const OrthancPluginImage* image)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3581 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3582 uint32_t height;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3583
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3584 _OrthancPluginGetImageInfo params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3585 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3586 params.image = image;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3587 params.resultUint32 = &height;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3588
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3589 if (context->InvokeService(context, _OrthancPluginService_GetImageHeight, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3590 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3591 return 0;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3592 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3593 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3594 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3595 return height;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3596 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3597 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3598
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3599
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3600
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3601 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3602 * @brief Return the pitch of an image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3603 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3604 * This function returns the pitch of the given image. The pitch is
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3605 * defined as the number of bytes between 2 successive lines of the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3606 * image in the memory buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3607 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3608 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3609 * @param image The image of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3610 * @return The pitch.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3611 * @ingroup Images
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3612 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3613 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImagePitch(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3614 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3615 const OrthancPluginImage* image)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3616 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3617 uint32_t pitch;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3618
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3619 _OrthancPluginGetImageInfo params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3620 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3621 params.image = image;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3622 params.resultUint32 = &pitch;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3623
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3624 if (context->InvokeService(context, _OrthancPluginService_GetImagePitch, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3625 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3626 return 0;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3627 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3628 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3629 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3630 return pitch;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3631 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3632 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3633
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3634
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3635
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3636 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3637 * @brief Return a pointer to the content of an image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3638 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3639 * This function returns a pointer to the memory buffer that
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3640 * contains the pixels of the image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3641 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3642 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3643 * @param image The image of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3644 * @return The pointer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3645 * @ingroup Images
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3646 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3647 ORTHANC_PLUGIN_INLINE void* OrthancPluginGetImageBuffer(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3648 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3649 const OrthancPluginImage* image)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3650 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3651 void* target = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3652
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3653 _OrthancPluginGetImageInfo params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3654 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3655 params.resultBuffer = &target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3656 params.image = image;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3657
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3658 if (context->InvokeService(context, _OrthancPluginService_GetImageBuffer, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3659 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3660 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3661 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3662 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3663 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3664 return target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3665 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3666 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3667
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3668
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3669 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3670 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3671 OrthancPluginImage** target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3672 const void* data;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3673 uint32_t size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3674 OrthancPluginImageFormat format;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3675 } _OrthancPluginUncompressImage;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3676
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3677
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3678 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3679 * @brief Decode a compressed image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3680 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3681 * This function decodes a compressed image from a memory buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3682 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3683 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3684 * @param data Pointer to a memory buffer containing the compressed image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3685 * @param size Size of the memory buffer containing the compressed image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3686 * @param format The file format of the compressed image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3687 * @return The uncompressed image. It must be freed with OrthancPluginFreeImage().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3688 * @ingroup Images
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3689 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3690 ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginUncompressImage(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3691 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3692 const void* data,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3693 uint32_t size,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3694 OrthancPluginImageFormat format)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3695 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3696 OrthancPluginImage* target = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3697
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3698 _OrthancPluginUncompressImage params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3699 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3700 params.target = &target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3701 params.data = data;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3702 params.size = size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3703 params.format = format;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3704
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3705 if (context->InvokeService(context, _OrthancPluginService_UncompressImage, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3706 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3707 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3708 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3709 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3710 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3711 return target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3712 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3713 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3714
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3715
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3716
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3717
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3718 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3719 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3720 OrthancPluginImage* image;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3721 } _OrthancPluginFreeImage;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3722
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3723 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3724 * @brief Free an image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3725 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3726 * This function frees an image that was decoded with OrthancPluginUncompressImage().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3727 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3728 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3729 * @param image The image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3730 * @ingroup Images
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3731 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3732 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeImage(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3733 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3734 OrthancPluginImage* image)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3735 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3736 _OrthancPluginFreeImage params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3737 params.image = image;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3738
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3739 context->InvokeService(context, _OrthancPluginService_FreeImage, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3740 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3741
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3742
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3743
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3744
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3745 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3746 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3747 OrthancPluginMemoryBuffer* target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3748 OrthancPluginImageFormat imageFormat;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3749 OrthancPluginPixelFormat pixelFormat;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3750 uint32_t width;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3751 uint32_t height;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3752 uint32_t pitch;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3753 const void* buffer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3754 uint8_t quality;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3755 } _OrthancPluginCompressImage;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3756
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3757
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3758 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3759 * @brief Encode a PNG image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3760 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3761 * This function compresses the given memory buffer containing an
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3762 * image using the PNG specification, and stores the result of the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3763 * compression into a newly allocated memory buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3764 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3765 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3766 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3767 * @param format The memory layout of the uncompressed image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3768 * @param width The width of the image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3769 * @param height The height of the image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3770 * @param pitch The pitch of the image (i.e. the number of bytes
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3771 * between 2 successive lines of the image in the memory buffer).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3772 * @param buffer The memory buffer containing the uncompressed image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3773 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3774 * @see OrthancPluginCompressAndAnswerPngImage()
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3775 * @ingroup Images
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3776 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3777 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressPngImage(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3778 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3779 OrthancPluginMemoryBuffer* target,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3780 OrthancPluginPixelFormat format,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3781 uint32_t width,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3782 uint32_t height,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3783 uint32_t pitch,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3784 const void* buffer)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3785 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3786 _OrthancPluginCompressImage params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3787 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3788 params.target = target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3789 params.imageFormat = OrthancPluginImageFormat_Png;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3790 params.pixelFormat = format;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3791 params.width = width;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3792 params.height = height;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3793 params.pitch = pitch;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3794 params.buffer = buffer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3795 params.quality = 0; /* Unused for PNG */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3796
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3797 return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3798 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3799
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3800
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3801 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3802 * @brief Encode a JPEG image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3803 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3804 * This function compresses the given memory buffer containing an
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3805 * image using the JPEG specification, and stores the result of the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3806 * compression into a newly allocated memory buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3807 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3808 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3809 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3810 * @param format The memory layout of the uncompressed image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3811 * @param width The width of the image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3812 * @param height The height of the image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3813 * @param pitch The pitch of the image (i.e. the number of bytes
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3814 * between 2 successive lines of the image in the memory buffer).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3815 * @param buffer The memory buffer containing the uncompressed image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3816 * @param quality The quality of the JPEG encoding, between 1 (worst
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3817 * quality, best compression) and 100 (best quality, worst
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3818 * compression).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3819 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3820 * @ingroup Images
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3821 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3822 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressJpegImage(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3823 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3824 OrthancPluginMemoryBuffer* target,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3825 OrthancPluginPixelFormat format,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3826 uint32_t width,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3827 uint32_t height,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3828 uint32_t pitch,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3829 const void* buffer,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3830 uint8_t quality)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3831 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3832 _OrthancPluginCompressImage params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3833 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3834 params.target = target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3835 params.imageFormat = OrthancPluginImageFormat_Jpeg;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3836 params.pixelFormat = format;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3837 params.width = width;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3838 params.height = height;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3839 params.pitch = pitch;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3840 params.buffer = buffer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3841 params.quality = quality;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3842
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3843 return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3844 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3845
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3846
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3847
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3848 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3849 * @brief Answer to a REST request with a JPEG image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3850 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3851 * This function answers to a REST request with a JPEG image. The
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3852 * parameters of this function describe a memory buffer that
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3853 * contains an uncompressed image. The image will be automatically compressed
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3854 * as a JPEG image by the core system of Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3855 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3856 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3857 * @param output The HTTP connection to the client application.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3858 * @param format The memory layout of the uncompressed image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3859 * @param width The width of the image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3860 * @param height The height of the image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3861 * @param pitch The pitch of the image (i.e. the number of bytes
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3862 * between 2 successive lines of the image in the memory buffer).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3863 * @param buffer The memory buffer containing the uncompressed image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3864 * @param quality The quality of the JPEG encoding, between 1 (worst
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3865 * quality, best compression) and 100 (best quality, worst
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3866 * compression).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3867 * @ingroup REST
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3868 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3869 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerJpegImage(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3870 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3871 OrthancPluginRestOutput* output,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3872 OrthancPluginPixelFormat format,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3873 uint32_t width,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3874 uint32_t height,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3875 uint32_t pitch,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3876 const void* buffer,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3877 uint8_t quality)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3878 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3879 _OrthancPluginCompressAndAnswerImage params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3880 params.output = output;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3881 params.imageFormat = OrthancPluginImageFormat_Jpeg;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3882 params.pixelFormat = format;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3883 params.width = width;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3884 params.height = height;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3885 params.pitch = pitch;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3886 params.buffer = buffer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3887 params.quality = quality;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3888 context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3889 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3890
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3891
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3892
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3893
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3894 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3895 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3896 OrthancPluginMemoryBuffer* target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3897 OrthancPluginHttpMethod method;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3898 const char* url;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3899 const char* username;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3900 const char* password;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3901 const char* body;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3902 uint32_t bodySize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3903 } _OrthancPluginCallHttpClient;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3904
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3905
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3906 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3907 * @brief Issue a HTTP GET call.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3908 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3909 * Make a HTTP GET call to the given URL. The result to the query is
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3910 * stored into a newly allocated memory buffer. Favor
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3911 * OrthancPluginRestApiGet() if calling the built-in REST API of the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3912 * Orthanc instance that hosts this plugin.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3913 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3914 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3915 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3916 * @param url The URL of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3917 * @param username The username (can be <tt>NULL</tt> if no password protection).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3918 * @param password The password (can be <tt>NULL</tt> if no password protection).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3919 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3920 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3921 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpGet(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3922 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3923 OrthancPluginMemoryBuffer* target,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3924 const char* url,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3925 const char* username,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3926 const char* password)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3927 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3928 _OrthancPluginCallHttpClient params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3929 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3930
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3931 params.target = target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3932 params.method = OrthancPluginHttpMethod_Get;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3933 params.url = url;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3934 params.username = username;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3935 params.password = password;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3936
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3937 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3938 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3939
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3940
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3941 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3942 * @brief Issue a HTTP POST call.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3943 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3944 * Make a HTTP POST call to the given URL. The result to the query
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3945 * is stored into a newly allocated memory buffer. Favor
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3946 * OrthancPluginRestApiPost() if calling the built-in REST API of
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3947 * the Orthanc instance that hosts this plugin.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3948 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3949 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3950 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3951 * @param url The URL of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3952 * @param body The content of the body of the request.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3953 * @param bodySize The size of the body of the request.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3954 * @param username The username (can be <tt>NULL</tt> if no password protection).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3955 * @param password The password (can be <tt>NULL</tt> if no password protection).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3956 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3957 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3958 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPost(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3959 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3960 OrthancPluginMemoryBuffer* target,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3961 const char* url,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3962 const char* body,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3963 uint32_t bodySize,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3964 const char* username,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3965 const char* password)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3966 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3967 _OrthancPluginCallHttpClient params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3968 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3969
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3970 params.target = target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3971 params.method = OrthancPluginHttpMethod_Post;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3972 params.url = url;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3973 params.body = body;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3974 params.bodySize = bodySize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3975 params.username = username;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3976 params.password = password;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3977
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3978 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3979 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3980
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3981
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3982 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3983 * @brief Issue a HTTP PUT call.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3984 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3985 * Make a HTTP PUT call to the given URL. The result to the query is
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3986 * stored into a newly allocated memory buffer. Favor
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3987 * OrthancPluginRestApiPut() if calling the built-in REST API of the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3988 * Orthanc instance that hosts this plugin.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3989 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3990 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3991 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3992 * @param url The URL of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3993 * @param body The content of the body of the request.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3994 * @param bodySize The size of the body of the request.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3995 * @param username The username (can be <tt>NULL</tt> if no password protection).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3996 * @param password The password (can be <tt>NULL</tt> if no password protection).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3997 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3998 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
3999 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPut(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4000 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4001 OrthancPluginMemoryBuffer* target,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4002 const char* url,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4003 const char* body,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4004 uint32_t bodySize,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4005 const char* username,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4006 const char* password)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4007 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4008 _OrthancPluginCallHttpClient params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4009 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4010
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4011 params.target = target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4012 params.method = OrthancPluginHttpMethod_Put;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4013 params.url = url;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4014 params.body = body;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4015 params.bodySize = bodySize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4016 params.username = username;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4017 params.password = password;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4018
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4019 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4020 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4021
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4022
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4023 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4024 * @brief Issue a HTTP DELETE call.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4025 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4026 * Make a HTTP DELETE call to the given URL. Favor
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4027 * OrthancPluginRestApiDelete() if calling the built-in REST API of
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4028 * the Orthanc instance that hosts this plugin.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4029 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4030 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4031 * @param url The URL of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4032 * @param username The username (can be <tt>NULL</tt> if no password protection).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4033 * @param password The password (can be <tt>NULL</tt> if no password protection).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4034 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4035 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4036 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpDelete(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4037 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4038 const char* url,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4039 const char* username,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4040 const char* password)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4041 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4042 _OrthancPluginCallHttpClient params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4043 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4044
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4045 params.method = OrthancPluginHttpMethod_Delete;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4046 params.url = url;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4047 params.username = username;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4048 params.password = password;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4049
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4050 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4051 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4052
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4053
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4054
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4055 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4056 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4057 OrthancPluginImage** target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4058 const OrthancPluginImage* source;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4059 OrthancPluginPixelFormat targetFormat;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4060 } _OrthancPluginConvertPixelFormat;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4061
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4062
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4063 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4064 * @brief Change the pixel format of an image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4065 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4066 * This function creates a new image, changing the memory layout of the pixels.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4067 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4068 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4069 * @param source The source image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4070 * @param targetFormat The target pixel format.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4071 * @return The resulting image. It must be freed with OrthancPluginFreeImage().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4072 * @ingroup Images
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4073 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4074 ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginConvertPixelFormat(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4075 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4076 const OrthancPluginImage* source,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4077 OrthancPluginPixelFormat targetFormat)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4078 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4079 OrthancPluginImage* target = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4080
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4081 _OrthancPluginConvertPixelFormat params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4082 params.target = &target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4083 params.source = source;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4084 params.targetFormat = targetFormat;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4085
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4086 if (context->InvokeService(context, _OrthancPluginService_ConvertPixelFormat, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4087 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4088 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4089 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4090 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4091 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4092 return target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4093 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4094 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4095
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4096
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4097
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4098 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4099 * @brief Return the number of available fonts.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4100 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4101 * This function returns the number of fonts that are built in the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4102 * Orthanc core. These fonts can be used to draw texts on images
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4103 * through OrthancPluginDrawText().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4104 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4105 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4106 * @return The number of fonts.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4107 * @ingroup Images
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4108 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4109 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontsCount(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4110 OrthancPluginContext* context)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4111 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4112 uint32_t count = 0;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4113
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4114 _OrthancPluginReturnSingleValue params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4115 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4116 params.resultUint32 = &count;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4117
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4118 if (context->InvokeService(context, _OrthancPluginService_GetFontsCount, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4119 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4120 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4121 return 0;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4122 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4123 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4124 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4125 return count;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4126 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4127 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4128
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4129
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4130
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4131
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4132 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4133 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4134 uint32_t fontIndex; /* in */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4135 const char** name; /* out */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4136 uint32_t* size; /* out */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4137 } _OrthancPluginGetFontInfo;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4138
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4139 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4140 * @brief Return the name of a font.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4141 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4142 * This function returns the name of a font that is built in the Orthanc core.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4143 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4144 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4145 * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4146 * @return The font name. This is a statically-allocated string, do not free it.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4147 * @ingroup Images
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4148 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4149 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetFontName(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4150 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4151 uint32_t fontIndex)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4152 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4153 const char* result = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4154
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4155 _OrthancPluginGetFontInfo params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4156 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4157 params.name = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4158 params.fontIndex = fontIndex;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4159
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4160 if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4161 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4162 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4163 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4164 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4165 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4166 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4167 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4168 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4169
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4170
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4171 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4172 * @brief Return the size of a font.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4173 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4174 * This function returns the size of a font that is built in the Orthanc core.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4175 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4176 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4177 * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4178 * @return The font size.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4179 * @ingroup Images
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4180 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4181 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontSize(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4182 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4183 uint32_t fontIndex)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4184 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4185 uint32_t result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4186
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4187 _OrthancPluginGetFontInfo params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4188 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4189 params.size = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4190 params.fontIndex = fontIndex;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4191
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4192 if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4193 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4194 return 0;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4195 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4196 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4197 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4198 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4199 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4200 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4201
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4202
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4203
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4204 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4205 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4206 OrthancPluginImage* image;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4207 uint32_t fontIndex;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4208 const char* utf8Text;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4209 int32_t x;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4210 int32_t y;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4211 uint8_t r;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4212 uint8_t g;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4213 uint8_t b;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4214 } _OrthancPluginDrawText;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4215
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4216
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4217 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4218 * @brief Draw text on an image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4219 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4220 * This function draws some text on some image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4221 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4222 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4223 * @param image The image upon which to draw the text.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4224 * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4225 * @param utf8Text The text to be drawn, encoded as an UTF-8 zero-terminated string.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4226 * @param x The X position of the text over the image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4227 * @param y The Y position of the text over the image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4228 * @param r The value of the red color channel of the text.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4229 * @param g The value of the green color channel of the text.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4230 * @param b The value of the blue color channel of the text.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4231 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4232 * @ingroup Images
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4233 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4234 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginDrawText(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4235 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4236 OrthancPluginImage* image,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4237 uint32_t fontIndex,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4238 const char* utf8Text,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4239 int32_t x,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4240 int32_t y,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4241 uint8_t r,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4242 uint8_t g,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4243 uint8_t b)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4244 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4245 _OrthancPluginDrawText params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4246 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4247 params.image = image;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4248 params.fontIndex = fontIndex;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4249 params.utf8Text = utf8Text;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4250 params.x = x;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4251 params.y = y;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4252 params.r = r;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4253 params.g = g;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4254 params.b = b;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4255
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4256 return context->InvokeService(context, _OrthancPluginService_DrawText, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4257 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4258
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4259
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4260
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4261 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4262 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4263 OrthancPluginStorageArea* storageArea;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4264 const char* uuid;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4265 const void* content;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4266 uint64_t size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4267 OrthancPluginContentType type;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4268 } _OrthancPluginStorageAreaCreate;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4269
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4270
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4271 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4272 * @brief Create a file inside the storage area.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4273 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4274 * This function creates a new file inside the storage area that is
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4275 * currently used by Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4276 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4277 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4278 * @param storageArea The storage area.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4279 * @param uuid The identifier of the file to be created.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4280 * @param content The content to store in the newly created file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4281 * @param size The size of the content.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4282 * @param type The type of the file content.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4283 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4284 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4285 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4286 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaCreate(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4287 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4288 OrthancPluginStorageArea* storageArea,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4289 const char* uuid,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4290 const void* content,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4291 uint64_t size,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4292 OrthancPluginContentType type)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4293 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4294 _OrthancPluginStorageAreaCreate params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4295 params.storageArea = storageArea;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4296 params.uuid = uuid;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4297 params.content = content;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4298 params.size = size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4299 params.type = type;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4300
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4301 return context->InvokeService(context, _OrthancPluginService_StorageAreaCreate, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4302 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4303
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4304
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4305 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4306 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4307 OrthancPluginMemoryBuffer* target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4308 OrthancPluginStorageArea* storageArea;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4309 const char* uuid;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4310 OrthancPluginContentType type;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4311 } _OrthancPluginStorageAreaRead;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4312
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4313
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4314 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4315 * @brief Read a file from the storage area.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4316 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4317 * This function reads the content of a given file from the storage
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4318 * area that is currently used by Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4319 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4320 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4321 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4322 * @param storageArea The storage area.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4323 * @param uuid The identifier of the file to be read.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4324 * @param type The type of the file content.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4325 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4326 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4327 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4328 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRead(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4329 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4330 OrthancPluginMemoryBuffer* target,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4331 OrthancPluginStorageArea* storageArea,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4332 const char* uuid,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4333 OrthancPluginContentType type)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4334 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4335 _OrthancPluginStorageAreaRead params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4336 params.target = target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4337 params.storageArea = storageArea;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4338 params.uuid = uuid;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4339 params.type = type;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4340
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4341 return context->InvokeService(context, _OrthancPluginService_StorageAreaRead, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4342 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4343
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4344
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4345 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4346 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4347 OrthancPluginStorageArea* storageArea;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4348 const char* uuid;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4349 OrthancPluginContentType type;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4350 } _OrthancPluginStorageAreaRemove;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4351
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4352 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4353 * @brief Remove a file from the storage area.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4354 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4355 * This function removes a given file from the storage area that is
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4356 * currently used by Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4357 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4358 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4359 * @param storageArea The storage area.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4360 * @param uuid The identifier of the file to be removed.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4361 * @param type The type of the file content.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4362 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4363 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4364 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4365 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRemove(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4366 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4367 OrthancPluginStorageArea* storageArea,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4368 const char* uuid,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4369 OrthancPluginContentType type)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4370 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4371 _OrthancPluginStorageAreaRemove params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4372 params.storageArea = storageArea;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4373 params.uuid = uuid;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4374 params.type = type;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4375
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4376 return context->InvokeService(context, _OrthancPluginService_StorageAreaRemove, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4377 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4378
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4379
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4380
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4381 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4382 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4383 OrthancPluginErrorCode* target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4384 int32_t code;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4385 uint16_t httpStatus;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4386 const char* message;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4387 } _OrthancPluginRegisterErrorCode;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4388
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4389 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4390 * @brief Declare a custom error code for this plugin.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4391 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4392 * This function declares a custom error code that can be generated
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4393 * by this plugin. This declaration is used to enrich the body of
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4394 * the HTTP answer in the case of an error, and to set the proper
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4395 * HTTP status code.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4396 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4397 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4398 * @param code The error code that is internal to this plugin.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4399 * @param httpStatus The HTTP status corresponding to this error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4400 * @param message The description of the error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4401 * @return The error code that has been assigned inside the Orthanc core.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4402 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4403 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4404 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterErrorCode(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4405 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4406 int32_t code,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4407 uint16_t httpStatus,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4408 const char* message)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4409 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4410 OrthancPluginErrorCode target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4411
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4412 _OrthancPluginRegisterErrorCode params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4413 params.target = &target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4414 params.code = code;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4415 params.httpStatus = httpStatus;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4416 params.message = message;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4417
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4418 if (context->InvokeService(context, _OrthancPluginService_RegisterErrorCode, &params) == OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4419 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4420 return target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4421 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4422 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4423 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4424 /* There was an error while assigned the error. Use a generic code. */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4425 return OrthancPluginErrorCode_Plugin;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4426 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4427 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4428
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4429
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4430
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4431 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4432 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4433 uint16_t group;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4434 uint16_t element;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4435 OrthancPluginValueRepresentation vr;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4436 const char* name;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4437 uint32_t minMultiplicity;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4438 uint32_t maxMultiplicity;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4439 } _OrthancPluginRegisterDictionaryTag;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4440
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4441 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4442 * @brief Register a new tag into the DICOM dictionary.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4443 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4444 * This function declares a new public tag in the dictionary of
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4445 * DICOM tags that are known to Orthanc. This function should be
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4446 * used in the OrthancPluginInitialize() callback.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4447 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4448 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4449 * @param group The group of the tag.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4450 * @param element The element of the tag.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4451 * @param vr The value representation of the tag.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4452 * @param name The nickname of the tag.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4453 * @param minMultiplicity The minimum multiplicity of the tag (must be above 0).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4454 * @param maxMultiplicity The maximum multiplicity of the tag. A value of 0 means
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4455 * an arbitrary multiplicity ("<tt>n</tt>").
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4456 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4457 * @see OrthancPluginRegisterPrivateDictionaryTag()
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4458 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4459 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4460 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDictionaryTag(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4461 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4462 uint16_t group,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4463 uint16_t element,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4464 OrthancPluginValueRepresentation vr,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4465 const char* name,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4466 uint32_t minMultiplicity,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4467 uint32_t maxMultiplicity)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4468 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4469 _OrthancPluginRegisterDictionaryTag params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4470 params.group = group;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4471 params.element = element;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4472 params.vr = vr;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4473 params.name = name;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4474 params.minMultiplicity = minMultiplicity;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4475 params.maxMultiplicity = maxMultiplicity;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4476
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4477 return context->InvokeService(context, _OrthancPluginService_RegisterDictionaryTag, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4478 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4479
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4480
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4481
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4482 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4483 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4484 uint16_t group;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4485 uint16_t element;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4486 OrthancPluginValueRepresentation vr;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4487 const char* name;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4488 uint32_t minMultiplicity;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4489 uint32_t maxMultiplicity;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4490 const char* privateCreator;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4491 } _OrthancPluginRegisterPrivateDictionaryTag;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4492
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4493 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4494 * @brief Register a new private tag into the DICOM dictionary.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4495 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4496 * This function declares a new private tag in the dictionary of
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4497 * DICOM tags that are known to Orthanc. This function should be
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4498 * used in the OrthancPluginInitialize() callback.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4499 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4500 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4501 * @param group The group of the tag.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4502 * @param element The element of the tag.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4503 * @param vr The value representation of the tag.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4504 * @param name The nickname of the tag.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4505 * @param minMultiplicity The minimum multiplicity of the tag (must be above 0).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4506 * @param maxMultiplicity The maximum multiplicity of the tag. A value of 0 means
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4507 * an arbitrary multiplicity ("<tt>n</tt>").
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4508 * @param privateCreator The private creator of this private tag.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4509 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4510 * @see OrthancPluginRegisterDictionaryTag()
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4511 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4512 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4513 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterPrivateDictionaryTag(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4514 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4515 uint16_t group,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4516 uint16_t element,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4517 OrthancPluginValueRepresentation vr,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4518 const char* name,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4519 uint32_t minMultiplicity,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4520 uint32_t maxMultiplicity,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4521 const char* privateCreator)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4522 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4523 _OrthancPluginRegisterPrivateDictionaryTag params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4524 params.group = group;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4525 params.element = element;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4526 params.vr = vr;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4527 params.name = name;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4528 params.minMultiplicity = minMultiplicity;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4529 params.maxMultiplicity = maxMultiplicity;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4530 params.privateCreator = privateCreator;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4531
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4532 return context->InvokeService(context, _OrthancPluginService_RegisterPrivateDictionaryTag, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4533 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4534
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4535
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4536
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4537 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4538 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4539 OrthancPluginStorageArea* storageArea;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4540 OrthancPluginResourceType level;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4541 } _OrthancPluginReconstructMainDicomTags;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4542
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4543 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4544 * @brief Reconstruct the main DICOM tags.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4545 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4546 * This function requests the Orthanc core to reconstruct the main
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4547 * DICOM tags of all the resources of the given type. This function
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4548 * can only be used as a part of the upgrade of a custom database
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4549 * back-end. A database transaction will be automatically setup.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4550 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4551 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4552 * @param storageArea The storage area.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4553 * @param level The type of the resources of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4554 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4555 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4556 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4557 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReconstructMainDicomTags(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4558 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4559 OrthancPluginStorageArea* storageArea,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4560 OrthancPluginResourceType level)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4561 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4562 _OrthancPluginReconstructMainDicomTags params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4563 params.level = level;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4564 params.storageArea = storageArea;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4565
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4566 return context->InvokeService(context, _OrthancPluginService_ReconstructMainDicomTags, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4567 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4568
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4569
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4570 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4571 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4572 char** result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4573 const char* instanceId;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4574 const void* buffer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4575 uint32_t size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4576 OrthancPluginDicomToJsonFormat format;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4577 OrthancPluginDicomToJsonFlags flags;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4578 uint32_t maxStringLength;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4579 } _OrthancPluginDicomToJson;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4580
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4581
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4582 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4583 * @brief Format a DICOM memory buffer as a JSON string.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4584 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4585 * This function takes as input a memory buffer containing a DICOM
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4586 * file, and outputs a JSON string representing the tags of this
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4587 * DICOM file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4588 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4589 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4590 * @param buffer The memory buffer containing the DICOM file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4591 * @param size The size of the memory buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4592 * @param format The output format.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4593 * @param flags Flags governing the output.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4594 * @param maxStringLength The maximum length of a field. Too long fields will
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4595 * be output as "null". The 0 value means no maximum length.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4596 * @return The NULL value if the case of an error, or the JSON
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4597 * string. This string must be freed by OrthancPluginFreeString().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4598 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4599 * @see OrthancPluginDicomInstanceToJson
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4600 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4601 ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomBufferToJson(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4602 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4603 const void* buffer,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4604 uint32_t size,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4605 OrthancPluginDicomToJsonFormat format,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4606 OrthancPluginDicomToJsonFlags flags,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4607 uint32_t maxStringLength)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4608 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4609 char* result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4610
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4611 _OrthancPluginDicomToJson params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4612 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4613 params.result = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4614 params.buffer = buffer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4615 params.size = size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4616 params.format = format;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4617 params.flags = flags;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4618 params.maxStringLength = maxStringLength;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4619
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4620 if (context->InvokeService(context, _OrthancPluginService_DicomBufferToJson, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4621 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4622 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4623 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4624 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4625 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4626 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4627 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4628 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4629 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4630
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4631
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4632 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4633 * @brief Format a DICOM instance as a JSON string.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4634 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4635 * This function formats a DICOM instance that is stored in Orthanc,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4636 * and outputs a JSON string representing the tags of this DICOM
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4637 * instance.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4638 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4639 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4640 * @param instanceId The Orthanc identifier of the instance.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4641 * @param format The output format.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4642 * @param flags Flags governing the output.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4643 * @param maxStringLength The maximum length of a field. Too long fields will
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4644 * be output as "null". The 0 value means no maximum length.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4645 * @return The NULL value if the case of an error, or the JSON
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4646 * string. This string must be freed by OrthancPluginFreeString().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4647 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4648 * @see OrthancPluginDicomInstanceToJson
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4649 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4650 ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomInstanceToJson(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4651 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4652 const char* instanceId,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4653 OrthancPluginDicomToJsonFormat format,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4654 OrthancPluginDicomToJsonFlags flags,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4655 uint32_t maxStringLength)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4656 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4657 char* result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4658
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4659 _OrthancPluginDicomToJson params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4660 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4661 params.result = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4662 params.instanceId = instanceId;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4663 params.format = format;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4664 params.flags = flags;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4665 params.maxStringLength = maxStringLength;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4666
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4667 if (context->InvokeService(context, _OrthancPluginService_DicomInstanceToJson, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4668 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4669 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4670 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4671 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4672 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4673 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4674 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4675 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4676 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4677
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4678
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4679 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4680 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4681 OrthancPluginMemoryBuffer* target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4682 const char* uri;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4683 uint32_t headersCount;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4684 const char* const* headersKeys;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4685 const char* const* headersValues;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4686 int32_t afterPlugins;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4687 } _OrthancPluginRestApiGet2;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4688
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4689 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4690 * @brief Make a GET call to the Orthanc REST API, with custom HTTP headers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4691 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4692 * Make a GET call to the Orthanc REST API with extended
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4693 * parameters. The result to the query is stored into a newly
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4694 * allocated memory buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4695 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4696 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4697 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4698 * @param uri The URI in the built-in Orthanc API.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4699 * @param headersCount The number of HTTP headers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4700 * @param headersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4701 * @param headersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4702 * @param afterPlugins If 0, the built-in API of Orthanc is used.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4703 * If 1, the API is tainted by the plugins.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4704 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4705 * @see OrthancPluginRestApiGet, OrthancPluginRestApiGetAfterPlugins
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4706 * @ingroup Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4707 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4708 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet2(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4709 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4710 OrthancPluginMemoryBuffer* target,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4711 const char* uri,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4712 uint32_t headersCount,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4713 const char* const* headersKeys,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4714 const char* const* headersValues,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4715 int32_t afterPlugins)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4716 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4717 _OrthancPluginRestApiGet2 params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4718 params.target = target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4719 params.uri = uri;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4720 params.headersCount = headersCount;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4721 params.headersKeys = headersKeys;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4722 params.headersValues = headersValues;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4723 params.afterPlugins = afterPlugins;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4724
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4725 return context->InvokeService(context, _OrthancPluginService_RestApiGet2, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4726 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4727
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4728
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4729
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4730 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4731 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4732 OrthancPluginWorklistCallback callback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4733 } _OrthancPluginWorklistCallback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4734
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4735 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4736 * @brief Register a callback to handle modality worklists requests.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4737 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4738 * This function registers a callback to handle C-Find SCP requests
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4739 * on modality worklists.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4740 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4741 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4742 * @param callback The callback.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4743 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4744 * @ingroup DicomCallbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4745 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4746 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterWorklistCallback(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4747 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4748 OrthancPluginWorklistCallback callback)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4749 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4750 _OrthancPluginWorklistCallback params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4751 params.callback = callback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4752
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4753 return context->InvokeService(context, _OrthancPluginService_RegisterWorklistCallback, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4754 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4755
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4756
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4757
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4758 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4759 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4760 OrthancPluginWorklistAnswers* answers;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4761 const OrthancPluginWorklistQuery* query;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4762 const void* dicom;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4763 uint32_t size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4764 } _OrthancPluginWorklistAnswersOperation;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4765
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4766 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4767 * @brief Add one answer to some modality worklist request.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4768 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4769 * This function adds one worklist (encoded as a DICOM file) to the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4770 * set of answers corresponding to some C-Find SCP request against
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4771 * modality worklists.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4772 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4773 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4774 * @param answers The set of answers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4775 * @param query The worklist query, as received by the callback.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4776 * @param dicom The worklist to answer, encoded as a DICOM file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4777 * @param size The size of the DICOM file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4778 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4779 * @ingroup DicomCallbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4780 * @see OrthancPluginCreateDicom()
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4781 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4782 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistAddAnswer(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4783 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4784 OrthancPluginWorklistAnswers* answers,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4785 const OrthancPluginWorklistQuery* query,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4786 const void* dicom,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4787 uint32_t size)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4788 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4789 _OrthancPluginWorklistAnswersOperation params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4790 params.answers = answers;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4791 params.query = query;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4792 params.dicom = dicom;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4793 params.size = size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4794
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4795 return context->InvokeService(context, _OrthancPluginService_WorklistAddAnswer, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4796 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4797
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4798
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4799 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4800 * @brief Mark the set of worklist answers as incomplete.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4801 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4802 * This function marks as incomplete the set of answers
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4803 * corresponding to some C-Find SCP request against modality
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4804 * worklists. This must be used if canceling the handling of a
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4805 * request when too many answers are to be returned.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4806 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4807 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4808 * @param answers The set of answers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4809 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4810 * @ingroup DicomCallbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4811 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4812 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistMarkIncomplete(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4813 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4814 OrthancPluginWorklistAnswers* answers)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4815 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4816 _OrthancPluginWorklistAnswersOperation params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4817 params.answers = answers;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4818 params.query = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4819 params.dicom = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4820 params.size = 0;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4821
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4822 return context->InvokeService(context, _OrthancPluginService_WorklistMarkIncomplete, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4823 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4824
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4825
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4826 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4827 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4828 const OrthancPluginWorklistQuery* query;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4829 const void* dicom;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4830 uint32_t size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4831 int32_t* isMatch;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4832 OrthancPluginMemoryBuffer* target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4833 } _OrthancPluginWorklistQueryOperation;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4834
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4835 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4836 * @brief Test whether a worklist matches the query.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4837 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4838 * This function checks whether one worklist (encoded as a DICOM
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4839 * file) matches the C-Find SCP query against modality
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4840 * worklists. This function must be called before adding the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4841 * worklist as an answer through OrthancPluginWorklistAddAnswer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4842 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4843 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4844 * @param query The worklist query, as received by the callback.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4845 * @param dicom The worklist to answer, encoded as a DICOM file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4846 * @param size The size of the DICOM file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4847 * @return 1 if the worklist matches the query, 0 otherwise.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4848 * @ingroup DicomCallbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4849 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4850 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginWorklistIsMatch(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4851 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4852 const OrthancPluginWorklistQuery* query,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4853 const void* dicom,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4854 uint32_t size)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4855 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4856 int32_t isMatch = 0;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4857
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4858 _OrthancPluginWorklistQueryOperation params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4859 params.query = query;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4860 params.dicom = dicom;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4861 params.size = size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4862 params.isMatch = &isMatch;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4863 params.target = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4864
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4865 if (context->InvokeService(context, _OrthancPluginService_WorklistIsMatch, &params) == OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4866 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4867 return isMatch;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4868 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4869 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4870 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4871 /* Error: Assume non-match */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4872 return 0;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4873 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4874 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4875
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4876
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4877 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4878 * @brief Retrieve the worklist query as a DICOM file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4879 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4880 * This function retrieves the DICOM file that underlies a C-Find
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4881 * SCP query against modality worklists.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4882 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4883 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4884 * @param target Memory buffer where to store the DICOM file. It must be freed with OrthancPluginFreeMemoryBuffer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4885 * @param query The worklist query, as received by the callback.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4886 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4887 * @ingroup DicomCallbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4888 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4889 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistGetDicomQuery(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4890 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4891 OrthancPluginMemoryBuffer* target,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4892 const OrthancPluginWorklistQuery* query)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4893 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4894 _OrthancPluginWorklistQueryOperation params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4895 params.query = query;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4896 params.dicom = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4897 params.size = 0;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4898 params.isMatch = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4899 params.target = target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4900
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4901 return context->InvokeService(context, _OrthancPluginService_WorklistGetDicomQuery, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4902 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4903
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4904
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4905 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4906 * @brief Get the origin of a DICOM file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4907 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4908 * This function returns the origin of a DICOM instance that has been received by Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4909 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4910 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4911 * @param instance The instance of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4912 * @return The origin of the instance.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4913 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4914 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4915 ORTHANC_PLUGIN_INLINE OrthancPluginInstanceOrigin OrthancPluginGetInstanceOrigin(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4916 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4917 OrthancPluginDicomInstance* instance)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4918 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4919 OrthancPluginInstanceOrigin origin;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4920
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4921 _OrthancPluginAccessDicomInstance params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4922 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4923 params.resultOrigin = &origin;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4924 params.instance = instance;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4925
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4926 if (context->InvokeService(context, _OrthancPluginService_GetInstanceOrigin, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4927 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4928 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4929 return OrthancPluginInstanceOrigin_Unknown;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4930 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4931 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4932 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4933 return origin;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4934 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4935 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4936
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4937
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4938 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4939 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4940 OrthancPluginMemoryBuffer* target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4941 const char* json;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4942 const OrthancPluginImage* pixelData;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4943 OrthancPluginCreateDicomFlags flags;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4944 } _OrthancPluginCreateDicom;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4945
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4946 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4947 * @brief Create a DICOM instance from a JSON string and an image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4948 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4949 * This function takes as input a string containing a JSON file
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4950 * describing the content of a DICOM instance. As an output, it
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4951 * writes the corresponding DICOM instance to a newly allocated
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4952 * memory buffer. Additionally, an image to be encoded within the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4953 * DICOM instance can also be provided.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4954 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4955 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4956 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4957 * @param json The input JSON file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4958 * @param pixelData The image. Can be NULL, if the pixel data is encoded inside the JSON with the data URI scheme.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4959 * @param flags Flags governing the output.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4960 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4961 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4962 * @see OrthancPluginDicomBufferToJson
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4963 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4964 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCreateDicom(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4965 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4966 OrthancPluginMemoryBuffer* target,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4967 const char* json,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4968 const OrthancPluginImage* pixelData,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4969 OrthancPluginCreateDicomFlags flags)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4970 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4971 _OrthancPluginCreateDicom params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4972 params.target = target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4973 params.json = json;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4974 params.pixelData = pixelData;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4975 params.flags = flags;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4976
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4977 return context->InvokeService(context, _OrthancPluginService_CreateDicom, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4978 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4979
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4980
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4981 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4982 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4983 OrthancPluginDecodeImageCallback callback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4984 } _OrthancPluginDecodeImageCallback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4985
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4986 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4987 * @brief Register a callback to handle the decoding of DICOM images.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4988 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4989 * This function registers a custom callback to the decoding of
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4990 * DICOM images, replacing the built-in decoder of Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4991 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4992 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4993 * @param callback The callback.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4994 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4995 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4996 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4997 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDecodeImageCallback(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4998 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
4999 OrthancPluginDecodeImageCallback callback)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5000 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5001 _OrthancPluginDecodeImageCallback params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5002 params.callback = callback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5003
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5004 return context->InvokeService(context, _OrthancPluginService_RegisterDecodeImageCallback, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5005 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5006
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5007
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5008
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5009 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5010 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5011 OrthancPluginImage** target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5012 OrthancPluginPixelFormat format;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5013 uint32_t width;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5014 uint32_t height;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5015 uint32_t pitch;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5016 void* buffer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5017 const void* constBuffer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5018 uint32_t bufferSize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5019 uint32_t frameIndex;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5020 } _OrthancPluginCreateImage;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5021
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5022
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5023 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5024 * @brief Create an image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5025 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5026 * This function creates an image of given size and format.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5027 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5028 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5029 * @param format The format of the pixels.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5030 * @param width The width of the image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5031 * @param height The height of the image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5032 * @return The newly allocated image. It must be freed with OrthancPluginFreeImage().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5033 * @ingroup Images
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5034 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5035 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginCreateImage(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5036 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5037 OrthancPluginPixelFormat format,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5038 uint32_t width,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5039 uint32_t height)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5040 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5041 OrthancPluginImage* target = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5042
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5043 _OrthancPluginCreateImage params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5044 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5045 params.target = &target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5046 params.format = format;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5047 params.width = width;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5048 params.height = height;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5049
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5050 if (context->InvokeService(context, _OrthancPluginService_CreateImage, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5051 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5052 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5053 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5054 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5055 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5056 return target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5057 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5058 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5059
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5060
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5061 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5062 * @brief Create an image pointing to a memory buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5063 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5064 * This function creates an image whose content points to a memory
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5065 * buffer managed by the plugin. Note that the buffer is directly
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5066 * accessed, no memory is allocated and no data is copied.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5067 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5068 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5069 * @param format The format of the pixels.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5070 * @param width The width of the image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5071 * @param height The height of the image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5072 * @param pitch The pitch of the image (i.e. the number of bytes
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5073 * between 2 successive lines of the image in the memory buffer).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5074 * @param buffer The memory buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5075 * @return The newly allocated image. It must be freed with OrthancPluginFreeImage().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5076 * @ingroup Images
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5077 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5078 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginCreateImageAccessor(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5079 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5080 OrthancPluginPixelFormat format,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5081 uint32_t width,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5082 uint32_t height,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5083 uint32_t pitch,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5084 void* buffer)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5085 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5086 OrthancPluginImage* target = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5087
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5088 _OrthancPluginCreateImage params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5089 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5090 params.target = &target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5091 params.format = format;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5092 params.width = width;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5093 params.height = height;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5094 params.pitch = pitch;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5095 params.buffer = buffer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5096
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5097 if (context->InvokeService(context, _OrthancPluginService_CreateImageAccessor, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5098 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5099 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5100 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5101 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5102 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5103 return target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5104 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5105 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5106
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5107
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5108
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5109 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5110 * @brief Decode one frame from a DICOM instance.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5111 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5112 * This function decodes one frame of a DICOM image that is stored
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5113 * in a memory buffer. This function will give the same result as
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5114 * OrthancPluginUncompressImage() for single-frame DICOM images.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5115 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5116 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5117 * @param buffer Pointer to a memory buffer containing the DICOM image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5118 * @param bufferSize Size of the memory buffer containing the DICOM image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5119 * @param frameIndex The index of the frame of interest in a multi-frame image.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5120 * @return The uncompressed image. It must be freed with OrthancPluginFreeImage().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5121 * @ingroup Images
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5122 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5123 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginDecodeDicomImage(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5124 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5125 const void* buffer,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5126 uint32_t bufferSize,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5127 uint32_t frameIndex)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5128 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5129 OrthancPluginImage* target = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5130
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5131 _OrthancPluginCreateImage params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5132 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5133 params.target = &target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5134 params.constBuffer = buffer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5135 params.bufferSize = bufferSize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5136 params.frameIndex = frameIndex;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5137
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5138 if (context->InvokeService(context, _OrthancPluginService_DecodeDicomImage, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5139 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5140 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5141 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5142 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5143 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5144 return target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5145 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5146 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5147
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5148
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5149
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5150 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5151 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5152 char** result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5153 const void* buffer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5154 uint32_t size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5155 } _OrthancPluginComputeHash;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5156
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5157 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5158 * @brief Compute an MD5 hash.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5159 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5160 * This functions computes the MD5 cryptographic hash of the given memory buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5161 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5162 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5163 * @param buffer The source memory buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5164 * @param size The size in bytes of the source buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5165 * @return The NULL value in case of error, or a string containing the cryptographic hash.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5166 * This string must be freed by OrthancPluginFreeString().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5167 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5168 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5169 ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeMd5(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5170 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5171 const void* buffer,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5172 uint32_t size)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5173 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5174 char* result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5175
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5176 _OrthancPluginComputeHash params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5177 params.result = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5178 params.buffer = buffer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5179 params.size = size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5180
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5181 if (context->InvokeService(context, _OrthancPluginService_ComputeMd5, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5182 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5183 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5184 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5185 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5186 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5187 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5188 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5189 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5190 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5191
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5192
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5193 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5194 * @brief Compute a SHA-1 hash.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5195 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5196 * This functions computes the SHA-1 cryptographic hash of the given memory buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5197 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5198 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5199 * @param buffer The source memory buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5200 * @param size The size in bytes of the source buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5201 * @return The NULL value in case of error, or a string containing the cryptographic hash.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5202 * This string must be freed by OrthancPluginFreeString().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5203 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5204 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5205 ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeSha1(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5206 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5207 const void* buffer,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5208 uint32_t size)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5209 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5210 char* result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5211
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5212 _OrthancPluginComputeHash params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5213 params.result = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5214 params.buffer = buffer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5215 params.size = size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5216
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5217 if (context->InvokeService(context, _OrthancPluginService_ComputeSha1, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5218 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5219 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5220 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5221 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5222 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5223 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5224 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5225 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5226 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5227
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5228
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5229
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5230 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5231 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5232 OrthancPluginDictionaryEntry* target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5233 const char* name;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5234 } _OrthancPluginLookupDictionary;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5235
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5236 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5237 * @brief Get information about the given DICOM tag.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5238 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5239 * This functions makes a lookup in the dictionary of DICOM tags
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5240 * that are known to Orthanc, and returns information about this
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5241 * tag. The tag can be specified using its human-readable name
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5242 * (e.g. "PatientName") or a set of two hexadecimal numbers
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5243 * (e.g. "0010-0020").
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5244 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5245 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5246 * @param target Where to store the information about the tag.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5247 * @param name The name of the DICOM tag.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5248 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5249 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5250 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5251 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginLookupDictionary(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5252 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5253 OrthancPluginDictionaryEntry* target,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5254 const char* name)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5255 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5256 _OrthancPluginLookupDictionary params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5257 params.target = target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5258 params.name = name;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5259 return context->InvokeService(context, _OrthancPluginService_LookupDictionary, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5260 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5261
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5262
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5263
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5264 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5265 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5266 OrthancPluginRestOutput* output;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5267 const char* answer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5268 uint32_t answerSize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5269 uint32_t headersCount;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5270 const char* const* headersKeys;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5271 const char* const* headersValues;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5272 } _OrthancPluginSendMultipartItem2;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5273
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5274 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5275 * @brief Send an item as a part of some HTTP multipart answer, with custom headers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5276 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5277 * This function sends an item as a part of some HTTP multipart
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5278 * answer that was initiated by OrthancPluginStartMultipartAnswer(). In addition to
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5279 * OrthancPluginSendMultipartItem(), this function will set HTTP header associated
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5280 * with the item.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5281 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5282 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5283 * @param output The HTTP connection to the client application.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5284 * @param answer Pointer to the memory buffer containing the item.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5285 * @param answerSize Number of bytes of the item.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5286 * @param headersCount The number of HTTP headers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5287 * @param headersKeys Array containing the keys of the HTTP headers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5288 * @param headersValues Array containing the values of the HTTP headers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5289 * @return 0 if success, or the error code if failure (this notably happens
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5290 * if the connection is closed by the client).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5291 * @see OrthancPluginSendMultipartItem()
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5292 * @ingroup REST
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5293 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5294 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem2(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5295 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5296 OrthancPluginRestOutput* output,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5297 const char* answer,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5298 uint32_t answerSize,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5299 uint32_t headersCount,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5300 const char* const* headersKeys,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5301 const char* const* headersValues)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5302 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5303 _OrthancPluginSendMultipartItem2 params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5304 params.output = output;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5305 params.answer = answer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5306 params.answerSize = answerSize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5307 params.headersCount = headersCount;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5308 params.headersKeys = headersKeys;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5309 params.headersValues = headersValues;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5310
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5311 return context->InvokeService(context, _OrthancPluginService_SendMultipartItem2, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5312 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5313
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5314
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5315 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5316 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5317 OrthancPluginIncomingHttpRequestFilter callback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5318 } _OrthancPluginIncomingHttpRequestFilter;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5319
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5320 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5321 * @brief Register a callback to filter incoming HTTP requests.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5322 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5323 * This function registers a custom callback to filter incoming HTTP/REST
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5324 * requests received by the HTTP server of Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5325 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5326 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5327 * @param callback The callback.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5328 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5329 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5330 * @deprecated Please instead use OrthancPluginRegisterIncomingHttpRequestFilter2()
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5331 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5332 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5333 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5334 OrthancPluginIncomingHttpRequestFilter callback)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5335 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5336 _OrthancPluginIncomingHttpRequestFilter params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5337 params.callback = callback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5338
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5339 return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5340 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5341
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5342
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5343
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5344 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5345 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5346 OrthancPluginMemoryBuffer* answerBody;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5347 OrthancPluginMemoryBuffer* answerHeaders;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5348 uint16_t* httpStatus;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5349 OrthancPluginHttpMethod method;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5350 const char* url;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5351 uint32_t headersCount;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5352 const char* const* headersKeys;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5353 const char* const* headersValues;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5354 const char* body;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5355 uint32_t bodySize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5356 const char* username;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5357 const char* password;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5358 uint32_t timeout;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5359 const char* certificateFile;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5360 const char* certificateKeyFile;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5361 const char* certificateKeyPassword;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5362 uint8_t pkcs11;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5363 } _OrthancPluginCallHttpClient2;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5364
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5365
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5366
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5367 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5368 * @brief Issue a HTTP call with full flexibility.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5369 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5370 * Make a HTTP call to the given URL. The result to the query is
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5371 * stored into a newly allocated memory buffer. The HTTP request
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5372 * will be done accordingly to the global configuration of Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5373 * (in particular, the options "HttpProxy", "HttpTimeout",
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5374 * "HttpsVerifyPeers", "HttpsCACertificates", and "Pkcs11" will be
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5375 * taken into account).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5376 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5377 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5378 * @param answerBody The target memory buffer (out argument).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5379 * It must be freed with OrthancPluginFreeMemoryBuffer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5380 * @param answerHeaders The target memory buffer for the HTTP headers in the answers (out argument).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5381 * The answer headers are formatted as a JSON object (associative array).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5382 * The buffer must be freed with OrthancPluginFreeMemoryBuffer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5383 * This argument can be set to NULL if the plugin has no interest in the HTTP headers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5384 * @param httpStatus The HTTP status after the execution of the request (out argument).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5385 * @param method HTTP method to be used.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5386 * @param url The URL of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5387 * @param headersCount The number of HTTP headers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5388 * @param headersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5389 * @param headersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5390 * @param username The username (can be <tt>NULL</tt> if no password protection).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5391 * @param password The password (can be <tt>NULL</tt> if no password protection).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5392 * @param body The HTTP body for a POST or PUT request.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5393 * @param bodySize The size of the body.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5394 * @param timeout Timeout in seconds (0 for default timeout).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5395 * @param certificateFile Path to the client certificate for HTTPS, in PEM format
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5396 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5397 * @param certificateKeyFile Path to the key of the client certificate for HTTPS, in PEM format
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5398 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5399 * @param certificateKeyPassword Password to unlock the key of the client certificate
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5400 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5401 * @param pkcs11 Enable PKCS#11 client authentication for hardware security modules and smart cards.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5402 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5403 * @see OrthancPluginCallPeerApi()
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5404 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5405 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpClient(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5406 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5407 OrthancPluginMemoryBuffer* answerBody,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5408 OrthancPluginMemoryBuffer* answerHeaders,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5409 uint16_t* httpStatus,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5410 OrthancPluginHttpMethod method,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5411 const char* url,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5412 uint32_t headersCount,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5413 const char* const* headersKeys,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5414 const char* const* headersValues,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5415 const char* body,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5416 uint32_t bodySize,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5417 const char* username,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5418 const char* password,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5419 uint32_t timeout,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5420 const char* certificateFile,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5421 const char* certificateKeyFile,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5422 const char* certificateKeyPassword,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5423 uint8_t pkcs11)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5424 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5425 _OrthancPluginCallHttpClient2 params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5426 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5427
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5428 params.answerBody = answerBody;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5429 params.answerHeaders = answerHeaders;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5430 params.httpStatus = httpStatus;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5431 params.method = method;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5432 params.url = url;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5433 params.headersCount = headersCount;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5434 params.headersKeys = headersKeys;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5435 params.headersValues = headersValues;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5436 params.body = body;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5437 params.bodySize = bodySize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5438 params.username = username;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5439 params.password = password;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5440 params.timeout = timeout;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5441 params.certificateFile = certificateFile;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5442 params.certificateKeyFile = certificateKeyFile;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5443 params.certificateKeyPassword = certificateKeyPassword;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5444 params.pkcs11 = pkcs11;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5445
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5446 return context->InvokeService(context, _OrthancPluginService_CallHttpClient2, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5447 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5448
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5449
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5450 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5451 * @brief Generate an UUID.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5452 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5453 * Generate a random GUID/UUID (globally unique identifier).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5454 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5455 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5456 * @return NULL in the case of an error, or a newly allocated string
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5457 * containing the UUID. This string must be freed by OrthancPluginFreeString().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5458 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5459 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5460 ORTHANC_PLUGIN_INLINE char* OrthancPluginGenerateUuid(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5461 OrthancPluginContext* context)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5462 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5463 char* result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5464
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5465 _OrthancPluginRetrieveDynamicString params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5466 params.result = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5467 params.argument = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5468
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5469 if (context->InvokeService(context, _OrthancPluginService_GenerateUuid, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5470 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5471 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5472 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5473 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5474 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5475 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5476 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5477 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5478 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5479
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5480
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5481
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5482
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5483 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5484 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5485 OrthancPluginFindCallback callback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5486 } _OrthancPluginFindCallback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5487
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5488 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5489 * @brief Register a callback to handle C-Find requests.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5490 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5491 * This function registers a callback to handle C-Find SCP requests
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5492 * that are not related to modality worklists.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5493 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5494 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5495 * @param callback The callback.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5496 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5497 * @ingroup DicomCallbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5498 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5499 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterFindCallback(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5500 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5501 OrthancPluginFindCallback callback)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5502 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5503 _OrthancPluginFindCallback params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5504 params.callback = callback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5505
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5506 return context->InvokeService(context, _OrthancPluginService_RegisterFindCallback, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5507 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5508
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5509
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5510 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5511 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5512 OrthancPluginFindAnswers *answers;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5513 const OrthancPluginFindQuery *query;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5514 const void *dicom;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5515 uint32_t size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5516 uint32_t index;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5517 uint32_t *resultUint32;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5518 uint16_t *resultGroup;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5519 uint16_t *resultElement;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5520 char **resultString;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5521 } _OrthancPluginFindOperation;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5522
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5523 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5524 * @brief Add one answer to some C-Find request.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5525 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5526 * This function adds one answer (encoded as a DICOM file) to the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5527 * set of answers corresponding to some C-Find SCP request that is
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5528 * not related to modality worklists.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5529 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5530 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5531 * @param answers The set of answers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5532 * @param dicom The answer to be added, encoded as a DICOM file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5533 * @param size The size of the DICOM file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5534 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5535 * @ingroup DicomCallbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5536 * @see OrthancPluginCreateDicom()
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5537 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5538 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginFindAddAnswer(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5539 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5540 OrthancPluginFindAnswers* answers,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5541 const void* dicom,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5542 uint32_t size)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5543 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5544 _OrthancPluginFindOperation params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5545 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5546 params.answers = answers;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5547 params.dicom = dicom;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5548 params.size = size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5549
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5550 return context->InvokeService(context, _OrthancPluginService_FindAddAnswer, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5551 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5552
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5553
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5554 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5555 * @brief Mark the set of C-Find answers as incomplete.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5556 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5557 * This function marks as incomplete the set of answers
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5558 * corresponding to some C-Find SCP request that is not related to
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5559 * modality worklists. This must be used if canceling the handling
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5560 * of a request when too many answers are to be returned.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5561 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5562 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5563 * @param answers The set of answers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5564 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5565 * @ingroup DicomCallbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5566 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5567 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginFindMarkIncomplete(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5568 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5569 OrthancPluginFindAnswers* answers)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5570 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5571 _OrthancPluginFindOperation params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5572 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5573 params.answers = answers;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5574
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5575 return context->InvokeService(context, _OrthancPluginService_FindMarkIncomplete, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5576 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5577
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5578
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5579
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5580 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5581 * @brief Get the number of tags in a C-Find query.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5582 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5583 * This function returns the number of tags that are contained in
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5584 * the given C-Find query.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5585 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5586 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5587 * @param query The C-Find query.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5588 * @return The number of tags.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5589 * @ingroup DicomCallbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5590 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5591 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFindQuerySize(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5592 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5593 const OrthancPluginFindQuery* query)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5594 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5595 uint32_t count = 0;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5596
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5597 _OrthancPluginFindOperation params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5598 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5599 params.query = query;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5600 params.resultUint32 = &count;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5601
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5602 if (context->InvokeService(context, _OrthancPluginService_GetFindQuerySize, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5603 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5604 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5605 return 0;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5606 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5607 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5608 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5609 return count;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5610 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5611 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5612
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5613
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5614 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5615 * @brief Get one tag in a C-Find query.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5616 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5617 * This function returns the group and the element of one DICOM tag
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5618 * in the given C-Find query.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5619 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5620 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5621 * @param group The group of the tag (output).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5622 * @param element The element of the tag (output).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5623 * @param query The C-Find query.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5624 * @param index The index of the tag of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5625 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5626 * @ingroup DicomCallbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5627 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5628 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetFindQueryTag(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5629 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5630 uint16_t* group,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5631 uint16_t* element,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5632 const OrthancPluginFindQuery* query,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5633 uint32_t index)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5634 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5635 _OrthancPluginFindOperation params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5636 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5637 params.query = query;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5638 params.index = index;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5639 params.resultGroup = group;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5640 params.resultElement = element;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5641
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5642 return context->InvokeService(context, _OrthancPluginService_GetFindQueryTag, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5643 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5644
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5645
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5646 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5647 * @brief Get the symbolic name of one tag in a C-Find query.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5648 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5649 * This function returns the symbolic name of one DICOM tag in the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5650 * given C-Find query.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5651 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5652 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5653 * @param query The C-Find query.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5654 * @param index The index of the tag of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5655 * @return The NULL value in case of error, or a string containing the name of the tag.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5656 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5657 * @ingroup DicomCallbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5658 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5659 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryTagName(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5660 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5661 const OrthancPluginFindQuery* query,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5662 uint32_t index)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5663 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5664 char* result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5665
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5666 _OrthancPluginFindOperation params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5667 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5668 params.query = query;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5669 params.index = index;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5670 params.resultString = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5671
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5672 if (context->InvokeService(context, _OrthancPluginService_GetFindQueryTagName, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5673 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5674 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5675 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5676 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5677 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5678 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5679 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5680 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5681 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5682
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5683
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5684 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5685 * @brief Get the value associated with one tag in a C-Find query.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5686 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5687 * This function returns the value associated with one tag in the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5688 * given C-Find query.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5689 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5690 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5691 * @param query The C-Find query.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5692 * @param index The index of the tag of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5693 * @return The NULL value in case of error, or a string containing the value of the tag.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5694 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5695 * @ingroup DicomCallbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5696 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5697 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryValue(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5698 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5699 const OrthancPluginFindQuery* query,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5700 uint32_t index)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5701 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5702 char* result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5703
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5704 _OrthancPluginFindOperation params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5705 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5706 params.query = query;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5707 params.index = index;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5708 params.resultString = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5709
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5710 if (context->InvokeService(context, _OrthancPluginService_GetFindQueryValue, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5711 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5712 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5713 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5714 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5715 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5716 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5717 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5718 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5719 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5720
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5721
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5722
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5723
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5724 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5725 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5726 OrthancPluginMoveCallback callback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5727 OrthancPluginGetMoveSize getMoveSize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5728 OrthancPluginApplyMove applyMove;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5729 OrthancPluginFreeMove freeMove;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5730 } _OrthancPluginMoveCallback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5731
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5732 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5733 * @brief Register a callback to handle C-Move requests.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5734 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5735 * This function registers a callback to handle C-Move SCP requests.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5736 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5737 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5738 * @param callback The main callback.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5739 * @param getMoveSize Callback to read the number of C-Move suboperations.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5740 * @param applyMove Callback to apply one C-Move suboperations.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5741 * @param freeMove Callback to free the C-Move driver.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5742 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5743 * @ingroup DicomCallbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5744 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5745 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterMoveCallback(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5746 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5747 OrthancPluginMoveCallback callback,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5748 OrthancPluginGetMoveSize getMoveSize,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5749 OrthancPluginApplyMove applyMove,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5750 OrthancPluginFreeMove freeMove)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5751 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5752 _OrthancPluginMoveCallback params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5753 params.callback = callback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5754 params.getMoveSize = getMoveSize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5755 params.applyMove = applyMove;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5756 params.freeMove = freeMove;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5757
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5758 return context->InvokeService(context, _OrthancPluginService_RegisterMoveCallback, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5759 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5760
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5761
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5762
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5763 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5764 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5765 OrthancPluginFindMatcher** target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5766 const void* query;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5767 uint32_t size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5768 } _OrthancPluginCreateFindMatcher;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5769
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5770
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5771 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5772 * @brief Create a C-Find matcher.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5773 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5774 * This function creates a "matcher" object that can be used to
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5775 * check whether a DICOM instance matches a C-Find query. The C-Find
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5776 * query must be expressed as a DICOM buffer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5777 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5778 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5779 * @param query The C-Find DICOM query.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5780 * @param size The size of the DICOM query.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5781 * @return The newly allocated matcher. It must be freed with OrthancPluginFreeFindMatcher().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5782 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5783 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5784 ORTHANC_PLUGIN_INLINE OrthancPluginFindMatcher* OrthancPluginCreateFindMatcher(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5785 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5786 const void* query,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5787 uint32_t size)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5788 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5789 OrthancPluginFindMatcher* target = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5790
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5791 _OrthancPluginCreateFindMatcher params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5792 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5793 params.target = &target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5794 params.query = query;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5795 params.size = size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5796
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5797 if (context->InvokeService(context, _OrthancPluginService_CreateFindMatcher, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5798 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5799 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5800 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5801 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5802 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5803 return target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5804 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5805 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5806
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5807
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5808 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5809 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5810 OrthancPluginFindMatcher* matcher;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5811 } _OrthancPluginFreeFindMatcher;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5812
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5813 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5814 * @brief Free a C-Find matcher.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5815 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5816 * This function frees a matcher that was created using OrthancPluginCreateFindMatcher().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5817 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5818 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5819 * @param matcher The matcher of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5820 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5821 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5822 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeFindMatcher(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5823 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5824 OrthancPluginFindMatcher* matcher)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5825 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5826 _OrthancPluginFreeFindMatcher params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5827 params.matcher = matcher;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5828
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5829 context->InvokeService(context, _OrthancPluginService_FreeFindMatcher, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5830 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5831
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5832
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5833 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5834 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5835 const OrthancPluginFindMatcher* matcher;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5836 const void* dicom;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5837 uint32_t size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5838 int32_t* isMatch;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5839 } _OrthancPluginFindMatcherIsMatch;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5840
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5841 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5842 * @brief Test whether a DICOM instance matches a C-Find query.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5843 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5844 * This function checks whether one DICOM instance matches C-Find
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5845 * matcher that was previously allocated using
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5846 * OrthancPluginCreateFindMatcher().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5847 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5848 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5849 * @param matcher The matcher of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5850 * @param dicom The DICOM instance to be matched.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5851 * @param size The size of the DICOM instance.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5852 * @return 1 if the DICOM instance matches the query, 0 otherwise.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5853 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5854 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5855 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginFindMatcherIsMatch(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5856 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5857 const OrthancPluginFindMatcher* matcher,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5858 const void* dicom,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5859 uint32_t size)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5860 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5861 int32_t isMatch = 0;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5862
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5863 _OrthancPluginFindMatcherIsMatch params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5864 params.matcher = matcher;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5865 params.dicom = dicom;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5866 params.size = size;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5867 params.isMatch = &isMatch;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5868
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5869 if (context->InvokeService(context, _OrthancPluginService_FindMatcherIsMatch, &params) == OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5870 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5871 return isMatch;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5872 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5873 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5874 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5875 /* Error: Assume non-match */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5876 return 0;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5877 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5878 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5879
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5880
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5881 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5882 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5883 OrthancPluginIncomingHttpRequestFilter2 callback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5884 } _OrthancPluginIncomingHttpRequestFilter2;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5885
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5886 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5887 * @brief Register a callback to filter incoming HTTP requests.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5888 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5889 * This function registers a custom callback to filter incoming HTTP/REST
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5890 * requests received by the HTTP server of Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5891 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5892 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5893 * @param callback The callback.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5894 * @return 0 if success, other value if error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5895 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5896 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5897 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter2(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5898 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5899 OrthancPluginIncomingHttpRequestFilter2 callback)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5900 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5901 _OrthancPluginIncomingHttpRequestFilter2 params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5902 params.callback = callback;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5903
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5904 return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter2, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5905 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5906
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5907
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5908
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5909 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5910 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5911 OrthancPluginPeers** peers;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5912 } _OrthancPluginGetPeers;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5913
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5914 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5915 * @brief Return the list of available Orthanc peers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5916 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5917 * This function returns the parameters of the Orthanc peers that are known to
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5918 * the Orthanc server hosting the plugin.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5919 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5920 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5921 * @return NULL if error, or a newly allocated opaque data structure containing the peers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5922 * This structure must be freed with OrthancPluginFreePeers().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5923 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5924 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5925 ORTHANC_PLUGIN_INLINE OrthancPluginPeers* OrthancPluginGetPeers(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5926 OrthancPluginContext* context)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5927 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5928 OrthancPluginPeers* peers = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5929
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5930 _OrthancPluginGetPeers params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5931 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5932 params.peers = &peers;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5933
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5934 if (context->InvokeService(context, _OrthancPluginService_GetPeers, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5935 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5936 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5937 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5938 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5939 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5940 return peers;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5941 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5942 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5943
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5944
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5945 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5946 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5947 OrthancPluginPeers* peers;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5948 } _OrthancPluginFreePeers;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5949
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5950 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5951 * @brief Free the list of available Orthanc peers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5952 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5953 * This function frees the data structure returned by OrthancPluginGetPeers().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5954 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5955 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5956 * @param peers The data structure describing the Orthanc peers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5957 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5958 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5959 ORTHANC_PLUGIN_INLINE void OrthancPluginFreePeers(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5960 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5961 OrthancPluginPeers* peers)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5962 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5963 _OrthancPluginFreePeers params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5964 params.peers = peers;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5965
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5966 context->InvokeService(context, _OrthancPluginService_FreePeers, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5967 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5968
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5969
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5970 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5971 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5972 uint32_t* target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5973 const OrthancPluginPeers* peers;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5974 } _OrthancPluginGetPeersCount;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5975
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5976 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5977 * @brief Get the number of Orthanc peers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5978 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5979 * This function returns the number of Orthanc peers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5980 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5981 * This function is thread-safe: Several threads sharing the same
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5982 * OrthancPluginPeers object can simultaneously call this function.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5983 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5984 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5985 * @param peers The data structure describing the Orthanc peers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5986 * @result The number of peers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5987 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5988 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5989 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetPeersCount(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5990 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5991 const OrthancPluginPeers* peers)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5992 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5993 uint32_t target = 0;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5994
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5995 _OrthancPluginGetPeersCount params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5996 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5997 params.target = &target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5998 params.peers = peers;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
5999
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6000 if (context->InvokeService(context, _OrthancPluginService_GetPeersCount, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6001 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6002 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6003 return 0;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6004 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6005 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6006 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6007 return target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6008 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6009 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6010
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6011
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6012 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6013 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6014 const char** target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6015 const OrthancPluginPeers* peers;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6016 uint32_t peerIndex;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6017 const char* userProperty;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6018 } _OrthancPluginGetPeerProperty;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6019
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6020 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6021 * @brief Get the symbolic name of an Orthanc peer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6022 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6023 * This function returns the symbolic name of the Orthanc peer,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6024 * which corresponds to the key of the "OrthancPeers" configuration
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6025 * option of Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6026 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6027 * This function is thread-safe: Several threads sharing the same
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6028 * OrthancPluginPeers object can simultaneously call this function.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6029 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6030 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6031 * @param peers The data structure describing the Orthanc peers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6032 * @param peerIndex The index of the peer of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6033 * This value must be lower than OrthancPluginGetPeersCount().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6034 * @result The symbolic name, or NULL in the case of an error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6035 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6036 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6037 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerName(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6038 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6039 const OrthancPluginPeers* peers,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6040 uint32_t peerIndex)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6041 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6042 const char* target = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6043
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6044 _OrthancPluginGetPeerProperty params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6045 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6046 params.target = &target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6047 params.peers = peers;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6048 params.peerIndex = peerIndex;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6049 params.userProperty = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6050
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6051 if (context->InvokeService(context, _OrthancPluginService_GetPeerName, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6052 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6053 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6054 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6055 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6056 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6057 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6058 return target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6059 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6060 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6061
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6062
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6063 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6064 * @brief Get the base URL of an Orthanc peer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6065 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6066 * This function returns the base URL to the REST API of some Orthanc peer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6067 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6068 * This function is thread-safe: Several threads sharing the same
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6069 * OrthancPluginPeers object can simultaneously call this function.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6070 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6071 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6072 * @param peers The data structure describing the Orthanc peers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6073 * @param peerIndex The index of the peer of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6074 * This value must be lower than OrthancPluginGetPeersCount().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6075 * @result The URL, or NULL in the case of an error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6076 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6077 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6078 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerUrl(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6079 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6080 const OrthancPluginPeers* peers,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6081 uint32_t peerIndex)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6082 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6083 const char* target = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6084
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6085 _OrthancPluginGetPeerProperty params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6086 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6087 params.target = &target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6088 params.peers = peers;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6089 params.peerIndex = peerIndex;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6090 params.userProperty = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6091
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6092 if (context->InvokeService(context, _OrthancPluginService_GetPeerUrl, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6093 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6094 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6095 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6096 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6097 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6098 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6099 return target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6100 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6101 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6102
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6103
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6104
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6105 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6106 * @brief Get some user-defined property of an Orthanc peer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6107 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6108 * This function returns some user-defined property of some Orthanc
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6109 * peer. An user-defined property is a property that is associated
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6110 * with the peer in the Orthanc configuration file, but that is not
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6111 * recognized by the Orthanc core.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6112 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6113 * This function is thread-safe: Several threads sharing the same
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6114 * OrthancPluginPeers object can simultaneously call this function.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6115 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6116 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6117 * @param peers The data structure describing the Orthanc peers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6118 * @param peerIndex The index of the peer of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6119 * This value must be lower than OrthancPluginGetPeersCount().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6120 * @param userProperty The user property of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6121 * @result The value of the user property, or NULL if it is not defined.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6122 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6123 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6124 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerUserProperty(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6125 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6126 const OrthancPluginPeers* peers,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6127 uint32_t peerIndex,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6128 const char* userProperty)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6129 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6130 const char* target = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6131
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6132 _OrthancPluginGetPeerProperty params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6133 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6134 params.target = &target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6135 params.peers = peers;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6136 params.peerIndex = peerIndex;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6137 params.userProperty = userProperty;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6138
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6139 if (context->InvokeService(context, _OrthancPluginService_GetPeerUserProperty, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6140 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6141 /* No such user property */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6142 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6143 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6144 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6145 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6146 return target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6147 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6148 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6149
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6150
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6151
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6152 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6153 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6154 OrthancPluginMemoryBuffer* answerBody;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6155 OrthancPluginMemoryBuffer* answerHeaders;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6156 uint16_t* httpStatus;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6157 const OrthancPluginPeers* peers;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6158 uint32_t peerIndex;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6159 OrthancPluginHttpMethod method;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6160 const char* uri;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6161 uint32_t additionalHeadersCount;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6162 const char* const* additionalHeadersKeys;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6163 const char* const* additionalHeadersValues;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6164 const char* body;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6165 uint32_t bodySize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6166 uint32_t timeout;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6167 } _OrthancPluginCallPeerApi;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6168
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6169 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6170 * @brief Call the REST API of an Orthanc peer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6171 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6172 * Make a REST call to the given URI in the REST API of a remote
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6173 * Orthanc peer. The result to the query is stored into a newly
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6174 * allocated memory buffer. The HTTP request will be done according
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6175 * to the "OrthancPeers" configuration option of Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6176 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6177 * This function is thread-safe: Several threads sharing the same
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6178 * OrthancPluginPeers object can simultaneously call this function.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6179 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6180 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6181 * @param answerBody The target memory buffer (out argument).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6182 * It must be freed with OrthancPluginFreeMemoryBuffer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6183 * @param answerHeaders The target memory buffer for the HTTP headers in the answers (out argument).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6184 * The answer headers are formatted as a JSON object (associative array).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6185 * The buffer must be freed with OrthancPluginFreeMemoryBuffer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6186 * This argument can be set to NULL if the plugin has no interest in the HTTP headers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6187 * @param httpStatus The HTTP status after the execution of the request (out argument).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6188 * @param peers The data structure describing the Orthanc peers.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6189 * @param peerIndex The index of the peer of interest.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6190 * This value must be lower than OrthancPluginGetPeersCount().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6191 * @param method HTTP method to be used.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6192 * @param uri The URI of interest in the REST API.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6193 * @param additionalHeadersCount The number of HTTP headers to be added to the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6194 * HTTP headers provided in the global configuration of Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6195 * @param additionalHeadersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6196 * @param additionalHeadersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6197 * @param body The HTTP body for a POST or PUT request.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6198 * @param bodySize The size of the body.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6199 * @param timeout Timeout in seconds (0 for default timeout).
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6200 * @return 0 if success, or the error code if failure.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6201 * @see OrthancPluginHttpClient()
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6202 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6203 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6204 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCallPeerApi(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6205 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6206 OrthancPluginMemoryBuffer* answerBody,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6207 OrthancPluginMemoryBuffer* answerHeaders,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6208 uint16_t* httpStatus,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6209 const OrthancPluginPeers* peers,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6210 uint32_t peerIndex,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6211 OrthancPluginHttpMethod method,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6212 const char* uri,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6213 uint32_t additionalHeadersCount,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6214 const char* const* additionalHeadersKeys,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6215 const char* const* additionalHeadersValues,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6216 const char* body,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6217 uint32_t bodySize,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6218 uint32_t timeout)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6219 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6220 _OrthancPluginCallPeerApi params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6221 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6222
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6223 params.answerBody = answerBody;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6224 params.answerHeaders = answerHeaders;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6225 params.httpStatus = httpStatus;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6226 params.peers = peers;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6227 params.peerIndex = peerIndex;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6228 params.method = method;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6229 params.uri = uri;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6230 params.additionalHeadersCount = additionalHeadersCount;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6231 params.additionalHeadersKeys = additionalHeadersKeys;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6232 params.additionalHeadersValues = additionalHeadersValues;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6233 params.body = body;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6234 params.bodySize = bodySize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6235 params.timeout = timeout;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6236
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6237 return context->InvokeService(context, _OrthancPluginService_CallPeerApi, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6238 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6239
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6240
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6241
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6242
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6243
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6244 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6245 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6246 OrthancPluginJob** target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6247 void *job;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6248 OrthancPluginJobFinalize finalize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6249 const char *type;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6250 OrthancPluginJobGetProgress getProgress;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6251 OrthancPluginJobGetContent getContent;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6252 OrthancPluginJobGetSerialized getSerialized;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6253 OrthancPluginJobStep step;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6254 OrthancPluginJobStop stop;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6255 OrthancPluginJobReset reset;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6256 } _OrthancPluginCreateJob;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6257
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6258 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6259 * @brief Create a custom job.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6260 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6261 * This function creates a custom job to be run by the jobs engine
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6262 * of Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6263 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6264 * Orthanc starts one dedicated thread per custom job that is
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6265 * running. It is guaranteed that all the callbacks will only be
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6266 * called from this single dedicated thread, in mutual exclusion: As
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6267 * a consequence, it is *not* mandatory to protect the various
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6268 * callbacks by mutexes.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6269 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6270 * The custom job can nonetheless launch its own processing threads
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6271 * on the first call to the "step()" callback, and stop them once
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6272 * the "stop()" callback is called.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6273 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6274 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6275 * @param job The job to be executed.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6276 * @param finalize The finalization callback.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6277 * @param type The type of the job, provided to the job unserializer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6278 * See OrthancPluginRegisterJobsUnserializer().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6279 * @param getProgress The progress callback.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6280 * @param getContent The content callback.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6281 * @param getSerialized The serialization callback.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6282 * @param step The callback to execute the individual steps of the job.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6283 * @param stop The callback that is invoked once the job leaves the "running" state.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6284 * @param reset The callback that is invoked if a stopped job is started again.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6285 * @return The newly allocated job. It must be freed with OrthancPluginFreeJob(),
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6286 * as long as it is not submitted with OrthancPluginSubmitJob().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6287 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6288 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6289 ORTHANC_PLUGIN_INLINE OrthancPluginJob *OrthancPluginCreateJob(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6290 OrthancPluginContext *context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6291 void *job,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6292 OrthancPluginJobFinalize finalize,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6293 const char *type,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6294 OrthancPluginJobGetProgress getProgress,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6295 OrthancPluginJobGetContent getContent,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6296 OrthancPluginJobGetSerialized getSerialized,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6297 OrthancPluginJobStep step,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6298 OrthancPluginJobStop stop,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6299 OrthancPluginJobReset reset)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6300 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6301 OrthancPluginJob* target = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6302
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6303 _OrthancPluginCreateJob params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6304 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6305
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6306 params.target = &target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6307 params.job = job;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6308 params.finalize = finalize;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6309 params.type = type;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6310 params.getProgress = getProgress;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6311 params.getContent = getContent;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6312 params.getSerialized = getSerialized;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6313 params.step = step;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6314 params.stop = stop;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6315 params.reset = reset;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6316
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6317 if (context->InvokeService(context, _OrthancPluginService_CreateJob, &params) != OrthancPluginErrorCode_Success ||
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6318 target == NULL)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6319 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6320 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6321 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6322 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6323 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6324 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6325 return target;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6326 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6327 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6328
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6329
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6330 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6331 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6332 OrthancPluginJob* job;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6333 } _OrthancPluginFreeJob;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6334
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6335 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6336 * @brief Free a custom job.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6337 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6338 * This function frees an image that was created with OrthancPluginCreateJob().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6339 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6340 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6341 * @param job The job.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6342 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6343 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6344 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeJob(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6345 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6346 OrthancPluginJob* job)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6347 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6348 _OrthancPluginFreeJob params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6349 params.job = job;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6350
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6351 context->InvokeService(context, _OrthancPluginService_FreeJob, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6352 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6353
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6354
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6355
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6356 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6357 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6358 char** resultId;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6359 OrthancPluginJob *job;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6360 int priority;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6361 } _OrthancPluginSubmitJob;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6362
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6363 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6364 * @brief Submit a new job to the jobs engine of Orthanc.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6365 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6366 * This function adds the given job to the pending jobs of
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6367 * Orthanc. Orthanc will take take of freeing it by invoking the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6368 * finalization callback provided to OrthancPluginCreateJob().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6369 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6370 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6371 * @param job The job, as received by OrthancPluginCreateJob().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6372 * @param priority The priority of the job.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6373 * @return ID of the newly-submitted job. This string must be freed by OrthancPluginFreeString().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6374 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6375 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6376 ORTHANC_PLUGIN_INLINE char *OrthancPluginSubmitJob(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6377 OrthancPluginContext *context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6378 OrthancPluginJob *job,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6379 int priority)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6380 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6381 char* resultId = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6382
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6383 _OrthancPluginSubmitJob params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6384 memset(&params, 0, sizeof(params));
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6385
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6386 params.resultId = &resultId;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6387 params.job = job;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6388 params.priority = priority;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6389
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6390 if (context->InvokeService(context, _OrthancPluginService_SubmitJob, &params) != OrthancPluginErrorCode_Success ||
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6391 resultId == NULL)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6392 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6393 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6394 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6395 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6396 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6397 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6398 return resultId;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6399 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6400 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6401
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6402
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6403
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6404 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6405 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6406 OrthancPluginJobsUnserializer unserializer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6407 } _OrthancPluginJobsUnserializer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6408
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6409 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6410 * @brief Register an unserializer for custom jobs.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6411 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6412 * This function registers an unserializer that decodes custom jobs
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6413 * from a JSON string. This callback is invoked when the jobs engine
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6414 * of Orthanc is started (on Orthanc initialization), for each job
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6415 * that is stored in the Orthanc database.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6416 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6417 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6418 * @param unserializer The job unserializer.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6419 * @ingroup Callbacks
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6420 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6421 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterJobsUnserializer(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6422 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6423 OrthancPluginJobsUnserializer unserializer)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6424 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6425 _OrthancPluginJobsUnserializer params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6426 params.unserializer = unserializer;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6427
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6428 context->InvokeService(context, _OrthancPluginService_RegisterJobsUnserializer, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6429 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6430
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6431
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6432
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6433 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6434 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6435 OrthancPluginRestOutput* output;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6436 const char* details;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6437 uint8_t log;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6438 } _OrthancPluginSetHttpErrorDetails;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6439
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6440 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6441 * @brief Provide a detailed description for an HTTP error.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6442 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6443 * This function sets the detailed description associated with an
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6444 * HTTP error. This description will be displayed in the "Details"
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6445 * field of the JSON body of the HTTP answer. It is only taken into
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6446 * consideration if the REST callback returns an error code that is
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6447 * different from "OrthancPluginErrorCode_Success", and if the
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6448 * "HttpDescribeErrors" configuration option of Orthanc is set to
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6449 * "true".
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6450 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6451 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6452 * @param output The HTTP connection to the client application.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6453 * @param details The details of the error message.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6454 * @param log Whether to also write the detailed error to the Orthanc logs.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6455 * @ingroup REST
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6456 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6457 ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpErrorDetails(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6458 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6459 OrthancPluginRestOutput* output,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6460 const char* details,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6461 uint8_t log)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6462 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6463 _OrthancPluginSetHttpErrorDetails params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6464 params.output = output;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6465 params.details = details;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6466 params.log = log;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6467 context->InvokeService(context, _OrthancPluginService_SetHttpErrorDetails, &params);
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6468 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6469
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6470
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6471
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6472 typedef struct
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6473 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6474 const char** result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6475 const char* argument;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6476 } _OrthancPluginRetrieveStaticString;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6477
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6478 /**
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6479 * @brief Detect the MIME type of a file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6480 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6481 * This function returns the MIME type of a file by inspecting its extension.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6482 *
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6483 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6484 * @param path Path to the file.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6485 * @return The MIME type. This is a statically-allocated
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6486 * string, do not free it.
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6487 * @ingroup Toolbox
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6488 **/
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6489 ORTHANC_PLUGIN_INLINE const char* OrthancPluginAutodetectMimeType(
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6490 OrthancPluginContext* context,
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6491 const char* path)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6492 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6493 const char* result = NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6494
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6495 _OrthancPluginRetrieveStaticString params;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6496 params.result = &result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6497 params.argument = path;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6498
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6499 if (context->InvokeService(context, _OrthancPluginService_AutodetectMimeType, &params) != OrthancPluginErrorCode_Success)
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6500 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6501 /* Error */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6502 return NULL;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6503 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6504 else
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6505 {
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6506 return result;
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6507 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6508 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6509
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6510
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6511 #ifdef __cplusplus
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6512 }
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6513 #endif
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6514
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6515
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6516 /** @} */
1256194e1c08 sync orthanc + sdk 1.5.0 + added more info in error logs
Alain Mazy <am@osimis.io>
parents:
diff changeset
6517