annotate Resources/Orthanc/Sdk-1.9.2/orthanc/OrthancCPlugin.h @ 505:38e428f8179d

more detailed error messages
author Alain Mazy <am@orthanc.team>
date Fri, 24 May 2024 16:39:38 +0200
parents c7dc70a0a477
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
272
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * \mainpage
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * This C/C++ SDK allows external developers to create plugins that
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 * can be loaded into Orthanc to extend its functionality. Each
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 * Orthanc plugin must expose 4 public functions with the following
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * signatures:
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * -# <tt>int32_t OrthancPluginInitialize(const OrthancPluginContext* context)</tt>:
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * This function is invoked by Orthanc when it loads the plugin on startup.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * The plugin must:
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * - Check its compatibility with the Orthanc version using
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * ::OrthancPluginCheckVersion().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * - Store the context pointer so that it can use the plugin
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * services of Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * - Register all its REST callbacks using ::OrthancPluginRegisterRestCallback().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * - Possibly register its callback for received DICOM instances using ::OrthancPluginRegisterOnStoredInstanceCallback().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * - Possibly register its callback for changes to the DICOM store using ::OrthancPluginRegisterOnChangeCallback().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * - Possibly register a custom storage area using ::OrthancPluginRegisterStorageArea2().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * - Possibly register a custom database back-end area using OrthancPluginRegisterDatabaseBackendV3().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 * - Possibly register a handler for C-Find SCP using OrthancPluginRegisterFindCallback().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 * - Possibly register a handler for C-Find SCP against DICOM worklists using OrthancPluginRegisterWorklistCallback().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 * - Possibly register a handler for C-Move SCP using OrthancPluginRegisterMoveCallback().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 * - Possibly register a custom decoder for DICOM images using OrthancPluginRegisterDecodeImageCallback().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 * - Possibly register a callback to filter incoming HTTP requests using OrthancPluginRegisterIncomingHttpRequestFilter2().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 * - Possibly register a callback to unserialize jobs using OrthancPluginRegisterJobsUnserializer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 * - Possibly register a callback to refresh its metrics using OrthancPluginRegisterRefreshMetricsCallback().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 * - Possibly register a callback to answer chunked HTTP transfers using ::OrthancPluginRegisterChunkedRestCallback().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 * - Possibly register a callback for Storage Commitment SCP using ::OrthancPluginRegisterStorageCommitmentScpCallback().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 * - Possibly register a callback to filter incoming DICOM instance using OrthancPluginRegisterIncomingDicomInstanceFilter().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 * - Possibly register a custom transcoder for DICOM images using OrthancPluginRegisterTranscoderCallback().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 * -# <tt>void OrthancPluginFinalize()</tt>:
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 * This function is invoked by Orthanc during its shutdown. The plugin
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 * must free all its memory.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 * -# <tt>const char* OrthancPluginGetName()</tt>:
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 * The plugin must return a short string to identify itself.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 * -# <tt>const char* OrthancPluginGetVersion()</tt>:
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 * The plugin must return a string containing its version number.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 * The name and the version of a plugin is only used to prevent it
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 * from being loaded twice. Note that, in C++, it is mandatory to
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 * declare these functions within an <tt>extern "C"</tt> section.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 * To ensure multi-threading safety, the various REST callbacks are
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 * guaranteed to be executed in mutual exclusion since Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 * 0.8.5. If this feature is undesired (notably when developing
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 * high-performance plugins handling simultaneous requests), use
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 * ::OrthancPluginRegisterRestCallbackNoLock().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 * @defgroup Images Images and compression
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 * @brief Functions to deal with images and compressed buffers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 * @defgroup REST REST
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 * @brief Functions to answer REST requests in a callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 * @defgroup Callbacks Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 * @brief Functions to register and manage callbacks by the plugins.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 * @defgroup DicomCallbacks DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 * @brief Functions to register and manage DICOM callbacks (worklists, C-FIND, C-MOVE, storage commitment).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 * @defgroup Orthanc Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 * @brief Functions to access the content of the Orthanc server.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 * @defgroup DicomInstance DicomInstance
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 * @brief Functions to access DICOM images that are managed by the Orthanc core.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 * @defgroup Toolbox Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 * @brief Generic functions to help with the creation of plugins.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 * Orthanc - A Lightweight, RESTful DICOM Store
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 * Department, University Hospital of Liege, Belgium
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 * Copyright (C) 2017-2021 Osimis S.A., Belgium
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 * This program is free software: you can redistribute it and/or
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 * modify it under the terms of the GNU General Public License as
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 * published by the Free Software Foundation, either version 3 of the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 * License, or (at your option) any later version.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 * This program is distributed in the hope that it will be useful, but
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 * WITHOUT ANY WARRANTY; without even the implied warranty of
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 * General Public License for more details.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 * You should have received a copy of the GNU General Public License
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 * along with this program. If not, see <http://www.gnu.org/licenses/>.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 #pragma once
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 #include <stdio.h>
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 #include <string.h>
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 #ifdef WIN32
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 # define ORTHANC_PLUGINS_API __declspec(dllexport)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 #elif __GNUC__ >= 4
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 # define ORTHANC_PLUGINS_API __attribute__ ((visibility ("default")))
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 #else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 # define ORTHANC_PLUGINS_API
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 #endif
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 #define ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER 1
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 #define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER 9
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120 #define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 2
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 #if !defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 #define ORTHANC_PLUGINS_VERSION_IS_ABOVE(major, minor, revision) \
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER > major || \
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER == major && \
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER > minor || \
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER == minor && \
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER >= revision))))
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 #endif
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 /********************************************************************
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 ** Check that function inlining is properly supported. The use of
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 ** inlining is required, to avoid the duplication of object code
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 ** between two compilation modules that would use the Orthanc Plugin
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 ** API.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 ********************************************************************/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 /* If the auto-detection of the "inline" keyword below does not work
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 automatically and that your compiler is known to properly support
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 inlining, uncomment the following #define and adapt the definition
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 of "static inline". */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 /* #define ORTHANC_PLUGIN_INLINE static inline */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 #ifndef ORTHANC_PLUGIN_INLINE
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 # if __STDC_VERSION__ >= 199901L
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 /* This is C99 or above: http://predef.sourceforge.net/prestd.html */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 # define ORTHANC_PLUGIN_INLINE static inline
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 # elif defined(__cplusplus)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 /* This is C++ */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 # define ORTHANC_PLUGIN_INLINE static inline
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 # elif defined(__GNUC__)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 /* This is GCC running in C89 mode */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 # define ORTHANC_PLUGIN_INLINE static __inline
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 # elif defined(_MSC_VER)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 /* This is Visual Studio running in C89 mode */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 # define ORTHANC_PLUGIN_INLINE static __inline
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 # else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 # error Your compiler is not known to support the "inline" keyword
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 # endif
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 #endif
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 /********************************************************************
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 ** Inclusion of standard libraries.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 ********************************************************************/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173 * For Microsoft Visual Studio, a compatibility "stdint.h" can be
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 * downloaded at the following URL:
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 * https://hg.orthanc-server.com/orthanc/raw-file/tip/Resources/ThirdParty/VisualStudio/stdint.h
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 #include <stdint.h>
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179 #include <stdlib.h>
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183 /********************************************************************
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184 ** Definition of the Orthanc Plugin API.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
185 ********************************************************************/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 /** @{ */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189 #ifdef __cplusplus
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190 extern "C"
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 #endif
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195 * The various error codes that can be returned by the Orthanc core.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197 typedef enum
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 OrthancPluginErrorCode_InternalError = -1 /*!< Internal error */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 OrthancPluginErrorCode_Success = 0 /*!< Success */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201 OrthancPluginErrorCode_Plugin = 1 /*!< Error encountered within the plugin engine */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202 OrthancPluginErrorCode_NotImplemented = 2 /*!< Not implemented yet */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 OrthancPluginErrorCode_ParameterOutOfRange = 3 /*!< Parameter out of range */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 OrthancPluginErrorCode_NotEnoughMemory = 4 /*!< The server hosting Orthanc is running out of memory */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205 OrthancPluginErrorCode_BadParameterType = 5 /*!< Bad type for a parameter */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206 OrthancPluginErrorCode_BadSequenceOfCalls = 6 /*!< Bad sequence of calls */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207 OrthancPluginErrorCode_InexistentItem = 7 /*!< Accessing an inexistent item */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208 OrthancPluginErrorCode_BadRequest = 8 /*!< Bad request */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209 OrthancPluginErrorCode_NetworkProtocol = 9 /*!< Error in the network protocol */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210 OrthancPluginErrorCode_SystemCommand = 10 /*!< Error while calling a system command */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211 OrthancPluginErrorCode_Database = 11 /*!< Error with the database engine */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212 OrthancPluginErrorCode_UriSyntax = 12 /*!< Badly formatted URI */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213 OrthancPluginErrorCode_InexistentFile = 13 /*!< Inexistent file */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214 OrthancPluginErrorCode_CannotWriteFile = 14 /*!< Cannot write to file */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215 OrthancPluginErrorCode_BadFileFormat = 15 /*!< Bad file format */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216 OrthancPluginErrorCode_Timeout = 16 /*!< Timeout */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 OrthancPluginErrorCode_UnknownResource = 17 /*!< Unknown resource */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218 OrthancPluginErrorCode_IncompatibleDatabaseVersion = 18 /*!< Incompatible version of the database */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219 OrthancPluginErrorCode_FullStorage = 19 /*!< The file storage is full */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220 OrthancPluginErrorCode_CorruptedFile = 20 /*!< Corrupted file (e.g. inconsistent MD5 hash) */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 OrthancPluginErrorCode_InexistentTag = 21 /*!< Inexistent tag */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222 OrthancPluginErrorCode_ReadOnly = 22 /*!< Cannot modify a read-only data structure */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223 OrthancPluginErrorCode_IncompatibleImageFormat = 23 /*!< Incompatible format of the images */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224 OrthancPluginErrorCode_IncompatibleImageSize = 24 /*!< Incompatible size of the images */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225 OrthancPluginErrorCode_SharedLibrary = 25 /*!< Error while using a shared library (plugin) */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226 OrthancPluginErrorCode_UnknownPluginService = 26 /*!< Plugin invoking an unknown service */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
227 OrthancPluginErrorCode_UnknownDicomTag = 27 /*!< Unknown DICOM tag */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 OrthancPluginErrorCode_BadJson = 28 /*!< Cannot parse a JSON document */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229 OrthancPluginErrorCode_Unauthorized = 29 /*!< Bad credentials were provided to an HTTP request */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
230 OrthancPluginErrorCode_BadFont = 30 /*!< Badly formatted font file */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
231 OrthancPluginErrorCode_DatabasePlugin = 31 /*!< The plugin implementing a custom database back-end does not fulfill the proper interface */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
232 OrthancPluginErrorCode_StorageAreaPlugin = 32 /*!< Error in the plugin implementing a custom storage area */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
233 OrthancPluginErrorCode_EmptyRequest = 33 /*!< The request is empty */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
234 OrthancPluginErrorCode_NotAcceptable = 34 /*!< Cannot send a response which is acceptable according to the Accept HTTP header */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
235 OrthancPluginErrorCode_NullPointer = 35 /*!< Cannot handle a NULL pointer */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
236 OrthancPluginErrorCode_DatabaseUnavailable = 36 /*!< The database is currently not available (probably a transient situation) */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
237 OrthancPluginErrorCode_CanceledJob = 37 /*!< This job was canceled */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
238 OrthancPluginErrorCode_BadGeometry = 38 /*!< Geometry error encountered in Stone */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
239 OrthancPluginErrorCode_SslInitialization = 39 /*!< Cannot initialize SSL encryption, check out your certificates */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
240 OrthancPluginErrorCode_DiscontinuedAbi = 40 /*!< Calling a function that has been removed from the Orthanc Framework */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
241 OrthancPluginErrorCode_BadRange = 41 /*!< Incorrect range request */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
242 OrthancPluginErrorCode_DatabaseCannotSerialize = 42 /*!< Database could not serialize access due to concurrent update, the transaction should be retried */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
243 OrthancPluginErrorCode_Revision = 43 /*!< A bad revision number was provided, which might indicate conflict between multiple writers */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
244 OrthancPluginErrorCode_SQLiteNotOpened = 1000 /*!< SQLite: The database is not opened */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
245 OrthancPluginErrorCode_SQLiteAlreadyOpened = 1001 /*!< SQLite: Connection is already open */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
246 OrthancPluginErrorCode_SQLiteCannotOpen = 1002 /*!< SQLite: Unable to open the database */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
247 OrthancPluginErrorCode_SQLiteStatementAlreadyUsed = 1003 /*!< SQLite: This cached statement is already being referred to */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
248 OrthancPluginErrorCode_SQLiteExecute = 1004 /*!< SQLite: Cannot execute a command */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
249 OrthancPluginErrorCode_SQLiteRollbackWithoutTransaction = 1005 /*!< SQLite: Rolling back a nonexistent transaction (have you called Begin()?) */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
250 OrthancPluginErrorCode_SQLiteCommitWithoutTransaction = 1006 /*!< SQLite: Committing a nonexistent transaction */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
251 OrthancPluginErrorCode_SQLiteRegisterFunction = 1007 /*!< SQLite: Unable to register a function */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
252 OrthancPluginErrorCode_SQLiteFlush = 1008 /*!< SQLite: Unable to flush the database */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
253 OrthancPluginErrorCode_SQLiteCannotRun = 1009 /*!< SQLite: Cannot run a cached statement */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
254 OrthancPluginErrorCode_SQLiteCannotStep = 1010 /*!< SQLite: Cannot step over a cached statement */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
255 OrthancPluginErrorCode_SQLiteBindOutOfRange = 1011 /*!< SQLite: Bing a value while out of range (serious error) */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
256 OrthancPluginErrorCode_SQLitePrepareStatement = 1012 /*!< SQLite: Cannot prepare a cached statement */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
257 OrthancPluginErrorCode_SQLiteTransactionAlreadyStarted = 1013 /*!< SQLite: Beginning the same transaction twice */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
258 OrthancPluginErrorCode_SQLiteTransactionCommit = 1014 /*!< SQLite: Failure when committing the transaction */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
259 OrthancPluginErrorCode_SQLiteTransactionBegin = 1015 /*!< SQLite: Cannot start a transaction */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
260 OrthancPluginErrorCode_DirectoryOverFile = 2000 /*!< The directory to be created is already occupied by a regular file */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
261 OrthancPluginErrorCode_FileStorageCannotWrite = 2001 /*!< Unable to create a subdirectory or a file in the file storage */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
262 OrthancPluginErrorCode_DirectoryExpected = 2002 /*!< The specified path does not point to a directory */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
263 OrthancPluginErrorCode_HttpPortInUse = 2003 /*!< The TCP port of the HTTP server is privileged or already in use */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
264 OrthancPluginErrorCode_DicomPortInUse = 2004 /*!< The TCP port of the DICOM server is privileged or already in use */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
265 OrthancPluginErrorCode_BadHttpStatusInRest = 2005 /*!< This HTTP status is not allowed in a REST API */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
266 OrthancPluginErrorCode_RegularFileExpected = 2006 /*!< The specified path does not point to a regular file */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
267 OrthancPluginErrorCode_PathToExecutable = 2007 /*!< Unable to get the path to the executable */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
268 OrthancPluginErrorCode_MakeDirectory = 2008 /*!< Cannot create a directory */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
269 OrthancPluginErrorCode_BadApplicationEntityTitle = 2009 /*!< An application entity title (AET) cannot be empty or be longer than 16 characters */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
270 OrthancPluginErrorCode_NoCFindHandler = 2010 /*!< No request handler factory for DICOM C-FIND SCP */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
271 OrthancPluginErrorCode_NoCMoveHandler = 2011 /*!< No request handler factory for DICOM C-MOVE SCP */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
272 OrthancPluginErrorCode_NoCStoreHandler = 2012 /*!< No request handler factory for DICOM C-STORE SCP */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
273 OrthancPluginErrorCode_NoApplicationEntityFilter = 2013 /*!< No application entity filter */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
274 OrthancPluginErrorCode_NoSopClassOrInstance = 2014 /*!< DicomUserConnection: Unable to find the SOP class and instance */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
275 OrthancPluginErrorCode_NoPresentationContext = 2015 /*!< DicomUserConnection: No acceptable presentation context for modality */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
276 OrthancPluginErrorCode_DicomFindUnavailable = 2016 /*!< DicomUserConnection: The C-FIND command is not supported by the remote SCP */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
277 OrthancPluginErrorCode_DicomMoveUnavailable = 2017 /*!< DicomUserConnection: The C-MOVE command is not supported by the remote SCP */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
278 OrthancPluginErrorCode_CannotStoreInstance = 2018 /*!< Cannot store an instance */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
279 OrthancPluginErrorCode_CreateDicomNotString = 2019 /*!< Only string values are supported when creating DICOM instances */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
280 OrthancPluginErrorCode_CreateDicomOverrideTag = 2020 /*!< Trying to override a value inherited from a parent module */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
281 OrthancPluginErrorCode_CreateDicomUseContent = 2021 /*!< Use \"Content\" to inject an image into a new DICOM instance */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
282 OrthancPluginErrorCode_CreateDicomNoPayload = 2022 /*!< No payload is present for one instance in the series */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
283 OrthancPluginErrorCode_CreateDicomUseDataUriScheme = 2023 /*!< The payload of the DICOM instance must be specified according to Data URI scheme */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
284 OrthancPluginErrorCode_CreateDicomBadParent = 2024 /*!< Trying to attach a new DICOM instance to an inexistent resource */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
285 OrthancPluginErrorCode_CreateDicomParentIsInstance = 2025 /*!< Trying to attach a new DICOM instance to an instance (must be a series, study or patient) */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
286 OrthancPluginErrorCode_CreateDicomParentEncoding = 2026 /*!< Unable to get the encoding of the parent resource */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
287 OrthancPluginErrorCode_UnknownModality = 2027 /*!< Unknown modality */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
288 OrthancPluginErrorCode_BadJobOrdering = 2028 /*!< Bad ordering of filters in a job */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
289 OrthancPluginErrorCode_JsonToLuaTable = 2029 /*!< Cannot convert the given JSON object to a Lua table */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
290 OrthancPluginErrorCode_CannotCreateLua = 2030 /*!< Cannot create the Lua context */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
291 OrthancPluginErrorCode_CannotExecuteLua = 2031 /*!< Cannot execute a Lua command */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
292 OrthancPluginErrorCode_LuaAlreadyExecuted = 2032 /*!< Arguments cannot be pushed after the Lua function is executed */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
293 OrthancPluginErrorCode_LuaBadOutput = 2033 /*!< The Lua function does not give the expected number of outputs */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
294 OrthancPluginErrorCode_NotLuaPredicate = 2034 /*!< The Lua function is not a predicate (only true/false outputs allowed) */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
295 OrthancPluginErrorCode_LuaReturnsNoString = 2035 /*!< The Lua function does not return a string */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
296 OrthancPluginErrorCode_StorageAreaAlreadyRegistered = 2036 /*!< Another plugin has already registered a custom storage area */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
297 OrthancPluginErrorCode_DatabaseBackendAlreadyRegistered = 2037 /*!< Another plugin has already registered a custom database back-end */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
298 OrthancPluginErrorCode_DatabaseNotInitialized = 2038 /*!< Plugin trying to call the database during its initialization */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
299 OrthancPluginErrorCode_SslDisabled = 2039 /*!< Orthanc has been built without SSL support */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
300 OrthancPluginErrorCode_CannotOrderSlices = 2040 /*!< Unable to order the slices of the series */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
301 OrthancPluginErrorCode_NoWorklistHandler = 2041 /*!< No request handler factory for DICOM C-Find Modality SCP */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
302 OrthancPluginErrorCode_AlreadyExistingTag = 2042 /*!< Cannot override the value of a tag that already exists */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
303 OrthancPluginErrorCode_NoStorageCommitmentHandler = 2043 /*!< No request handler factory for DICOM N-ACTION SCP (storage commitment) */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
304 OrthancPluginErrorCode_NoCGetHandler = 2044 /*!< No request handler factory for DICOM C-GET SCP */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
305 OrthancPluginErrorCode_UnsupportedMediaType = 3000 /*!< Unsupported media type */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
306
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
307 _OrthancPluginErrorCode_INTERNAL = 0x7fffffff
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
308 } OrthancPluginErrorCode;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
309
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
310
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
311 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
312 * Forward declaration of one of the mandatory functions for Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
313 * plugins.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
314 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
315 ORTHANC_PLUGINS_API const char* OrthancPluginGetName();
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
316
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
317
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
318 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
319 * The various HTTP methods for a REST call.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
320 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
321 typedef enum
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
322 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
323 OrthancPluginHttpMethod_Get = 1, /*!< GET request */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
324 OrthancPluginHttpMethod_Post = 2, /*!< POST request */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
325 OrthancPluginHttpMethod_Put = 3, /*!< PUT request */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
326 OrthancPluginHttpMethod_Delete = 4, /*!< DELETE request */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
327
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
328 _OrthancPluginHttpMethod_INTERNAL = 0x7fffffff
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
329 } OrthancPluginHttpMethod;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
330
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
331
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
332 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
333 * @brief The parameters of a REST request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
334 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
335 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
336 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
337 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
338 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
339 * @brief The HTTP method.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
340 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
341 OrthancPluginHttpMethod method;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
342
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
343 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
344 * @brief The number of groups of the regular expression.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
345 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
346 uint32_t groupsCount;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
347
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
348 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
349 * @brief The matched values for the groups of the regular expression.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
350 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
351 const char* const* groups;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
352
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
353 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
354 * @brief For a GET request, the number of GET parameters.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
355 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
356 uint32_t getCount;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
357
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
358 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
359 * @brief For a GET request, the keys of the GET parameters.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
360 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
361 const char* const* getKeys;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
362
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
363 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
364 * @brief For a GET request, the values of the GET parameters.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
365 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
366 const char* const* getValues;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
367
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
368 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
369 * @brief For a PUT or POST request, the content of the body.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
370 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
371 const void* body;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
372
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
373 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
374 * @brief For a PUT or POST request, the number of bytes of the body.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
375 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
376 uint32_t bodySize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
377
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
378
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
379 /* --------------------------------------------------
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
380 New in version 0.8.1
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
381 -------------------------------------------------- */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
382
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
383 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
384 * @brief The number of HTTP headers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
385 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
386 uint32_t headersCount;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
387
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
388 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
389 * @brief The keys of the HTTP headers (always converted to low-case).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
390 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
391 const char* const* headersKeys;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
392
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
393 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
394 * @brief The values of the HTTP headers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
395 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
396 const char* const* headersValues;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
397
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
398 } OrthancPluginHttpRequest;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
399
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
400
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
401 typedef enum
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
402 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
403 /* Generic services */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
404 _OrthancPluginService_LogInfo = 1,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
405 _OrthancPluginService_LogWarning = 2,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
406 _OrthancPluginService_LogError = 3,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
407 _OrthancPluginService_GetOrthancPath = 4,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
408 _OrthancPluginService_GetOrthancDirectory = 5,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
409 _OrthancPluginService_GetConfigurationPath = 6,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
410 _OrthancPluginService_SetPluginProperty = 7,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
411 _OrthancPluginService_GetGlobalProperty = 8,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
412 _OrthancPluginService_SetGlobalProperty = 9,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
413 _OrthancPluginService_GetCommandLineArgumentsCount = 10,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
414 _OrthancPluginService_GetCommandLineArgument = 11,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
415 _OrthancPluginService_GetExpectedDatabaseVersion = 12,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
416 _OrthancPluginService_GetConfiguration = 13,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
417 _OrthancPluginService_BufferCompression = 14,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
418 _OrthancPluginService_ReadFile = 15,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
419 _OrthancPluginService_WriteFile = 16,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
420 _OrthancPluginService_GetErrorDescription = 17,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
421 _OrthancPluginService_CallHttpClient = 18,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
422 _OrthancPluginService_RegisterErrorCode = 19,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
423 _OrthancPluginService_RegisterDictionaryTag = 20,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
424 _OrthancPluginService_DicomBufferToJson = 21,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
425 _OrthancPluginService_DicomInstanceToJson = 22,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
426 _OrthancPluginService_CreateDicom = 23,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
427 _OrthancPluginService_ComputeMd5 = 24,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
428 _OrthancPluginService_ComputeSha1 = 25,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
429 _OrthancPluginService_LookupDictionary = 26,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
430 _OrthancPluginService_CallHttpClient2 = 27,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
431 _OrthancPluginService_GenerateUuid = 28,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
432 _OrthancPluginService_RegisterPrivateDictionaryTag = 29,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
433 _OrthancPluginService_AutodetectMimeType = 30,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
434 _OrthancPluginService_SetMetricsValue = 31,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
435 _OrthancPluginService_EncodeDicomWebJson = 32,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
436 _OrthancPluginService_EncodeDicomWebXml = 33,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
437 _OrthancPluginService_ChunkedHttpClient = 34, /* New in Orthanc 1.5.7 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
438 _OrthancPluginService_GetTagName = 35, /* New in Orthanc 1.5.7 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
439 _OrthancPluginService_EncodeDicomWebJson2 = 36, /* New in Orthanc 1.7.0 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
440 _OrthancPluginService_EncodeDicomWebXml2 = 37, /* New in Orthanc 1.7.0 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
441 _OrthancPluginService_CreateMemoryBuffer = 38, /* New in Orthanc 1.7.0 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
442 _OrthancPluginService_GenerateRestApiAuthorizationToken = 39, /* New in Orthanc 1.8.1 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
443 _OrthancPluginService_CreateMemoryBuffer64 = 40, /* New in Orthanc 1.9.0 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
444 _OrthancPluginService_CreateDicom2 = 41, /* New in Orthanc 1.9.0 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
445
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
446 /* Registration of callbacks */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
447 _OrthancPluginService_RegisterRestCallback = 1000,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
448 _OrthancPluginService_RegisterOnStoredInstanceCallback = 1001,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
449 _OrthancPluginService_RegisterStorageArea = 1002,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
450 _OrthancPluginService_RegisterOnChangeCallback = 1003,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
451 _OrthancPluginService_RegisterRestCallbackNoLock = 1004,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
452 _OrthancPluginService_RegisterWorklistCallback = 1005,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
453 _OrthancPluginService_RegisterDecodeImageCallback = 1006,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
454 _OrthancPluginService_RegisterIncomingHttpRequestFilter = 1007,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
455 _OrthancPluginService_RegisterFindCallback = 1008,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
456 _OrthancPluginService_RegisterMoveCallback = 1009,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
457 _OrthancPluginService_RegisterIncomingHttpRequestFilter2 = 1010,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
458 _OrthancPluginService_RegisterRefreshMetricsCallback = 1011,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
459 _OrthancPluginService_RegisterChunkedRestCallback = 1012, /* New in Orthanc 1.5.7 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
460 _OrthancPluginService_RegisterStorageCommitmentScpCallback = 1013,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
461 _OrthancPluginService_RegisterIncomingDicomInstanceFilter = 1014,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
462 _OrthancPluginService_RegisterTranscoderCallback = 1015, /* New in Orthanc 1.7.0 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
463 _OrthancPluginService_RegisterStorageArea2 = 1016, /* New in Orthanc 1.9.0 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
464
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
465 /* Sending answers to REST calls */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
466 _OrthancPluginService_AnswerBuffer = 2000,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
467 _OrthancPluginService_CompressAndAnswerPngImage = 2001, /* Unused as of Orthanc 0.9.4 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
468 _OrthancPluginService_Redirect = 2002,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
469 _OrthancPluginService_SendHttpStatusCode = 2003,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
470 _OrthancPluginService_SendUnauthorized = 2004,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
471 _OrthancPluginService_SendMethodNotAllowed = 2005,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
472 _OrthancPluginService_SetCookie = 2006,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
473 _OrthancPluginService_SetHttpHeader = 2007,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
474 _OrthancPluginService_StartMultipartAnswer = 2008,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
475 _OrthancPluginService_SendMultipartItem = 2009,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
476 _OrthancPluginService_SendHttpStatus = 2010,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
477 _OrthancPluginService_CompressAndAnswerImage = 2011,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
478 _OrthancPluginService_SendMultipartItem2 = 2012,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
479 _OrthancPluginService_SetHttpErrorDetails = 2013,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
480
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
481 /* Access to the Orthanc database and API */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
482 _OrthancPluginService_GetDicomForInstance = 3000,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
483 _OrthancPluginService_RestApiGet = 3001,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
484 _OrthancPluginService_RestApiPost = 3002,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
485 _OrthancPluginService_RestApiDelete = 3003,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
486 _OrthancPluginService_RestApiPut = 3004,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
487 _OrthancPluginService_LookupPatient = 3005,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
488 _OrthancPluginService_LookupStudy = 3006,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
489 _OrthancPluginService_LookupSeries = 3007,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
490 _OrthancPluginService_LookupInstance = 3008,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
491 _OrthancPluginService_LookupStudyWithAccessionNumber = 3009,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
492 _OrthancPluginService_RestApiGetAfterPlugins = 3010,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
493 _OrthancPluginService_RestApiPostAfterPlugins = 3011,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
494 _OrthancPluginService_RestApiDeleteAfterPlugins = 3012,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
495 _OrthancPluginService_RestApiPutAfterPlugins = 3013,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
496 _OrthancPluginService_ReconstructMainDicomTags = 3014,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
497 _OrthancPluginService_RestApiGet2 = 3015,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
498 _OrthancPluginService_CallRestApi = 3016, /* New in Orthanc 1.9.2 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
499
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
500 /* Access to DICOM instances */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
501 _OrthancPluginService_GetInstanceRemoteAet = 4000,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
502 _OrthancPluginService_GetInstanceSize = 4001,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
503 _OrthancPluginService_GetInstanceData = 4002,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
504 _OrthancPluginService_GetInstanceJson = 4003,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
505 _OrthancPluginService_GetInstanceSimplifiedJson = 4004,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
506 _OrthancPluginService_HasInstanceMetadata = 4005,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
507 _OrthancPluginService_GetInstanceMetadata = 4006,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
508 _OrthancPluginService_GetInstanceOrigin = 4007,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
509 _OrthancPluginService_GetInstanceTransferSyntaxUid = 4008,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
510 _OrthancPluginService_HasInstancePixelData = 4009,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
511 _OrthancPluginService_CreateDicomInstance = 4010, /* New in Orthanc 1.7.0 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
512 _OrthancPluginService_FreeDicomInstance = 4011, /* New in Orthanc 1.7.0 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
513 _OrthancPluginService_GetInstanceFramesCount = 4012, /* New in Orthanc 1.7.0 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
514 _OrthancPluginService_GetInstanceRawFrame = 4013, /* New in Orthanc 1.7.0 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
515 _OrthancPluginService_GetInstanceDecodedFrame = 4014, /* New in Orthanc 1.7.0 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
516 _OrthancPluginService_TranscodeDicomInstance = 4015, /* New in Orthanc 1.7.0 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
517 _OrthancPluginService_SerializeDicomInstance = 4016, /* New in Orthanc 1.7.0 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
518 _OrthancPluginService_GetInstanceAdvancedJson = 4017, /* New in Orthanc 1.7.0 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
519 _OrthancPluginService_GetInstanceDicomWebJson = 4018, /* New in Orthanc 1.7.0 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
520 _OrthancPluginService_GetInstanceDicomWebXml = 4019, /* New in Orthanc 1.7.0 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
521
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
522 /* Services for plugins implementing a database back-end */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
523 _OrthancPluginService_RegisterDatabaseBackend = 5000, /* New in Orthanc 0.8.6 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
524 _OrthancPluginService_DatabaseAnswer = 5001,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
525 _OrthancPluginService_RegisterDatabaseBackendV2 = 5002, /* New in Orthanc 0.9.4 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
526 _OrthancPluginService_StorageAreaCreate = 5003,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
527 _OrthancPluginService_StorageAreaRead = 5004,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
528 _OrthancPluginService_StorageAreaRemove = 5005,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
529 _OrthancPluginService_RegisterDatabaseBackendV3 = 5006, /* New in Orthanc 1.9.2 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
530
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
531 /* Primitives for handling images */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
532 _OrthancPluginService_GetImagePixelFormat = 6000,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
533 _OrthancPluginService_GetImageWidth = 6001,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
534 _OrthancPluginService_GetImageHeight = 6002,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
535 _OrthancPluginService_GetImagePitch = 6003,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
536 _OrthancPluginService_GetImageBuffer = 6004,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
537 _OrthancPluginService_UncompressImage = 6005,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
538 _OrthancPluginService_FreeImage = 6006,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
539 _OrthancPluginService_CompressImage = 6007,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
540 _OrthancPluginService_ConvertPixelFormat = 6008,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
541 _OrthancPluginService_GetFontsCount = 6009,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
542 _OrthancPluginService_GetFontInfo = 6010,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
543 _OrthancPluginService_DrawText = 6011,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
544 _OrthancPluginService_CreateImage = 6012,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
545 _OrthancPluginService_CreateImageAccessor = 6013,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
546 _OrthancPluginService_DecodeDicomImage = 6014,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
547
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
548 /* Primitives for handling C-Find, C-Move and worklists */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
549 _OrthancPluginService_WorklistAddAnswer = 7000,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
550 _OrthancPluginService_WorklistMarkIncomplete = 7001,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
551 _OrthancPluginService_WorklistIsMatch = 7002,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
552 _OrthancPluginService_WorklistGetDicomQuery = 7003,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
553 _OrthancPluginService_FindAddAnswer = 7004,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
554 _OrthancPluginService_FindMarkIncomplete = 7005,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
555 _OrthancPluginService_GetFindQuerySize = 7006,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
556 _OrthancPluginService_GetFindQueryTag = 7007,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
557 _OrthancPluginService_GetFindQueryTagName = 7008,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
558 _OrthancPluginService_GetFindQueryValue = 7009,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
559 _OrthancPluginService_CreateFindMatcher = 7010,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
560 _OrthancPluginService_FreeFindMatcher = 7011,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
561 _OrthancPluginService_FindMatcherIsMatch = 7012,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
562
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
563 /* Primitives for accessing Orthanc Peers (new in 1.4.2) */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
564 _OrthancPluginService_GetPeers = 8000,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
565 _OrthancPluginService_FreePeers = 8001,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
566 _OrthancPluginService_GetPeersCount = 8003,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
567 _OrthancPluginService_GetPeerName = 8004,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
568 _OrthancPluginService_GetPeerUrl = 8005,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
569 _OrthancPluginService_CallPeerApi = 8006,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
570 _OrthancPluginService_GetPeerUserProperty = 8007,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
571
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
572 /* Primitives for handling jobs (new in 1.4.2) */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
573 _OrthancPluginService_CreateJob = 9000,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
574 _OrthancPluginService_FreeJob = 9001,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
575 _OrthancPluginService_SubmitJob = 9002,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
576 _OrthancPluginService_RegisterJobsUnserializer = 9003,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
577
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
578 _OrthancPluginService_INTERNAL = 0x7fffffff
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
579 } _OrthancPluginService;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
580
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
581
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
582 typedef enum
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
583 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
584 _OrthancPluginProperty_Description = 1,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
585 _OrthancPluginProperty_RootUri = 2,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
586 _OrthancPluginProperty_OrthancExplorer = 3,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
587
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
588 _OrthancPluginProperty_INTERNAL = 0x7fffffff
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
589 } _OrthancPluginProperty;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
590
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
591
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
592
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
593 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
594 * The memory layout of the pixels of an image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
595 * @ingroup Images
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
596 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
597 typedef enum
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
598 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
599 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
600 * @brief Graylevel 8bpp image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
601 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
602 * The image is graylevel. Each pixel is unsigned and stored in
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
603 * one byte.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
604 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
605 OrthancPluginPixelFormat_Grayscale8 = 1,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
606
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
607 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
608 * @brief Graylevel, unsigned 16bpp image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
609 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
610 * The image is graylevel. Each pixel is unsigned and stored in
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
611 * two bytes.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
612 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
613 OrthancPluginPixelFormat_Grayscale16 = 2,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
614
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
615 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
616 * @brief Graylevel, signed 16bpp image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
617 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
618 * The image is graylevel. Each pixel is signed and stored in two
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
619 * bytes.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
620 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
621 OrthancPluginPixelFormat_SignedGrayscale16 = 3,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
622
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
623 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
624 * @brief Color image in RGB24 format.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
625 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
626 * This format describes a color image. The pixels are stored in 3
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
627 * consecutive bytes. The memory layout is RGB.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
628 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
629 OrthancPluginPixelFormat_RGB24 = 4,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
630
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
631 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
632 * @brief Color image in RGBA32 format.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
633 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
634 * This format describes a color image. The pixels are stored in 4
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
635 * consecutive bytes. The memory layout is RGBA.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
636 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
637 OrthancPluginPixelFormat_RGBA32 = 5,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
638
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
639 OrthancPluginPixelFormat_Unknown = 6, /*!< Unknown pixel format */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
640
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
641 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
642 * @brief Color image in RGB48 format.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
643 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
644 * This format describes a color image. The pixels are stored in 6
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
645 * consecutive bytes. The memory layout is RRGGBB.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
646 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
647 OrthancPluginPixelFormat_RGB48 = 7,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
648
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
649 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
650 * @brief Graylevel, unsigned 32bpp image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
651 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
652 * The image is graylevel. Each pixel is unsigned and stored in
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
653 * four bytes.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
654 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
655 OrthancPluginPixelFormat_Grayscale32 = 8,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
656
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
657 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
658 * @brief Graylevel, floating-point 32bpp image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
659 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
660 * The image is graylevel. Each pixel is floating-point and stored
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
661 * in four bytes.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
662 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
663 OrthancPluginPixelFormat_Float32 = 9,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
664
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
665 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
666 * @brief Color image in BGRA32 format.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
667 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
668 * This format describes a color image. The pixels are stored in 4
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
669 * consecutive bytes. The memory layout is BGRA.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
670 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
671 OrthancPluginPixelFormat_BGRA32 = 10,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
672
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
673 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
674 * @brief Graylevel, unsigned 64bpp image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
675 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
676 * The image is graylevel. Each pixel is unsigned and stored in
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
677 * eight bytes.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
678 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
679 OrthancPluginPixelFormat_Grayscale64 = 11,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
680
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
681 _OrthancPluginPixelFormat_INTERNAL = 0x7fffffff
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
682 } OrthancPluginPixelFormat;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
683
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
684
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
685
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
686 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
687 * The content types that are supported by Orthanc plugins.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
688 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
689 typedef enum
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
690 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
691 OrthancPluginContentType_Unknown = 0, /*!< Unknown content type */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
692 OrthancPluginContentType_Dicom = 1, /*!< DICOM */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
693 OrthancPluginContentType_DicomAsJson = 2, /*!< JSON summary of a DICOM file */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
694 OrthancPluginContentType_DicomUntilPixelData = 3, /*!< DICOM Header till pixel data */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
695
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
696 _OrthancPluginContentType_INTERNAL = 0x7fffffff
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
697 } OrthancPluginContentType;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
698
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
699
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
700
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
701 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
702 * The supported types of DICOM resources.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
703 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
704 typedef enum
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
705 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
706 OrthancPluginResourceType_Patient = 0, /*!< Patient */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
707 OrthancPluginResourceType_Study = 1, /*!< Study */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
708 OrthancPluginResourceType_Series = 2, /*!< Series */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
709 OrthancPluginResourceType_Instance = 3, /*!< Instance */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
710 OrthancPluginResourceType_None = 4, /*!< Unavailable resource type */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
711
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
712 _OrthancPluginResourceType_INTERNAL = 0x7fffffff
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
713 } OrthancPluginResourceType;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
714
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
715
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
716
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
717 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
718 * The supported types of changes that can be signaled to the change callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
719 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
720 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
721 typedef enum
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
722 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
723 OrthancPluginChangeType_CompletedSeries = 0, /*!< Series is now complete */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
724 OrthancPluginChangeType_Deleted = 1, /*!< Deleted resource */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
725 OrthancPluginChangeType_NewChildInstance = 2, /*!< A new instance was added to this resource */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
726 OrthancPluginChangeType_NewInstance = 3, /*!< New instance received */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
727 OrthancPluginChangeType_NewPatient = 4, /*!< New patient created */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
728 OrthancPluginChangeType_NewSeries = 5, /*!< New series created */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
729 OrthancPluginChangeType_NewStudy = 6, /*!< New study created */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
730 OrthancPluginChangeType_StablePatient = 7, /*!< Timeout: No new instance in this patient */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
731 OrthancPluginChangeType_StableSeries = 8, /*!< Timeout: No new instance in this series */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
732 OrthancPluginChangeType_StableStudy = 9, /*!< Timeout: No new instance in this study */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
733 OrthancPluginChangeType_OrthancStarted = 10, /*!< Orthanc has started */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
734 OrthancPluginChangeType_OrthancStopped = 11, /*!< Orthanc is stopping */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
735 OrthancPluginChangeType_UpdatedAttachment = 12, /*!< Some user-defined attachment has changed for this resource */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
736 OrthancPluginChangeType_UpdatedMetadata = 13, /*!< Some user-defined metadata has changed for this resource */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
737 OrthancPluginChangeType_UpdatedPeers = 14, /*!< The list of Orthanc peers has changed */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
738 OrthancPluginChangeType_UpdatedModalities = 15, /*!< The list of DICOM modalities has changed */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
739 OrthancPluginChangeType_JobSubmitted = 16, /*!< New Job submitted */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
740 OrthancPluginChangeType_JobSuccess = 17, /*!< A Job has completed successfully */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
741 OrthancPluginChangeType_JobFailure = 18, /*!< A Job has failed */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
742
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
743 _OrthancPluginChangeType_INTERNAL = 0x7fffffff
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
744 } OrthancPluginChangeType;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
745
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
746
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
747 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
748 * The compression algorithms that are supported by the Orthanc core.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
749 * @ingroup Images
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
750 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
751 typedef enum
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
752 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
753 OrthancPluginCompressionType_Zlib = 0, /*!< Standard zlib compression */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
754 OrthancPluginCompressionType_ZlibWithSize = 1, /*!< zlib, prefixed with uncompressed size (uint64_t) */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
755 OrthancPluginCompressionType_Gzip = 2, /*!< Standard gzip compression */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
756 OrthancPluginCompressionType_GzipWithSize = 3, /*!< gzip, prefixed with uncompressed size (uint64_t) */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
757
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
758 _OrthancPluginCompressionType_INTERNAL = 0x7fffffff
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
759 } OrthancPluginCompressionType;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
760
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
761
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
762 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
763 * The image formats that are supported by the Orthanc core.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
764 * @ingroup Images
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
765 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
766 typedef enum
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
767 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
768 OrthancPluginImageFormat_Png = 0, /*!< Image compressed using PNG */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
769 OrthancPluginImageFormat_Jpeg = 1, /*!< Image compressed using JPEG */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
770 OrthancPluginImageFormat_Dicom = 2, /*!< Image compressed using DICOM */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
771
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
772 _OrthancPluginImageFormat_INTERNAL = 0x7fffffff
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
773 } OrthancPluginImageFormat;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
774
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
775
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
776 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
777 * The value representations present in the DICOM standard (version 2013).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
778 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
779 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
780 typedef enum
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
781 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
782 OrthancPluginValueRepresentation_AE = 1, /*!< Application Entity */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
783 OrthancPluginValueRepresentation_AS = 2, /*!< Age String */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
784 OrthancPluginValueRepresentation_AT = 3, /*!< Attribute Tag */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
785 OrthancPluginValueRepresentation_CS = 4, /*!< Code String */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
786 OrthancPluginValueRepresentation_DA = 5, /*!< Date */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
787 OrthancPluginValueRepresentation_DS = 6, /*!< Decimal String */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
788 OrthancPluginValueRepresentation_DT = 7, /*!< Date Time */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
789 OrthancPluginValueRepresentation_FD = 8, /*!< Floating Point Double */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
790 OrthancPluginValueRepresentation_FL = 9, /*!< Floating Point Single */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
791 OrthancPluginValueRepresentation_IS = 10, /*!< Integer String */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
792 OrthancPluginValueRepresentation_LO = 11, /*!< Long String */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
793 OrthancPluginValueRepresentation_LT = 12, /*!< Long Text */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
794 OrthancPluginValueRepresentation_OB = 13, /*!< Other Byte String */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
795 OrthancPluginValueRepresentation_OF = 14, /*!< Other Float String */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
796 OrthancPluginValueRepresentation_OW = 15, /*!< Other Word String */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
797 OrthancPluginValueRepresentation_PN = 16, /*!< Person Name */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
798 OrthancPluginValueRepresentation_SH = 17, /*!< Short String */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
799 OrthancPluginValueRepresentation_SL = 18, /*!< Signed Long */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
800 OrthancPluginValueRepresentation_SQ = 19, /*!< Sequence of Items */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
801 OrthancPluginValueRepresentation_SS = 20, /*!< Signed Short */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
802 OrthancPluginValueRepresentation_ST = 21, /*!< Short Text */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
803 OrthancPluginValueRepresentation_TM = 22, /*!< Time */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
804 OrthancPluginValueRepresentation_UI = 23, /*!< Unique Identifier (UID) */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
805 OrthancPluginValueRepresentation_UL = 24, /*!< Unsigned Long */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
806 OrthancPluginValueRepresentation_UN = 25, /*!< Unknown */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
807 OrthancPluginValueRepresentation_US = 26, /*!< Unsigned Short */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
808 OrthancPluginValueRepresentation_UT = 27, /*!< Unlimited Text */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
809
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
810 _OrthancPluginValueRepresentation_INTERNAL = 0x7fffffff
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
811 } OrthancPluginValueRepresentation;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
812
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
813
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
814 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
815 * The possible output formats for a DICOM-to-JSON conversion.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
816 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
817 * @see OrthancPluginDicomToJson()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
818 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
819 typedef enum
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
820 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
821 OrthancPluginDicomToJsonFormat_Full = 1, /*!< Full output, with most details */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
822 OrthancPluginDicomToJsonFormat_Short = 2, /*!< Tags output as hexadecimal numbers */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
823 OrthancPluginDicomToJsonFormat_Human = 3, /*!< Human-readable JSON */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
824
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
825 _OrthancPluginDicomToJsonFormat_INTERNAL = 0x7fffffff
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
826 } OrthancPluginDicomToJsonFormat;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
827
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
828
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
829 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
830 * Flags to customize a DICOM-to-JSON conversion. By default, binary
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
831 * tags are formatted using Data URI scheme.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
832 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
833 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
834 typedef enum
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
835 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
836 OrthancPluginDicomToJsonFlags_None = 0,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
837 OrthancPluginDicomToJsonFlags_IncludeBinary = (1 << 0), /*!< Include the binary tags */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
838 OrthancPluginDicomToJsonFlags_IncludePrivateTags = (1 << 1), /*!< Include the private tags */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
839 OrthancPluginDicomToJsonFlags_IncludeUnknownTags = (1 << 2), /*!< Include the tags unknown by the dictionary */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
840 OrthancPluginDicomToJsonFlags_IncludePixelData = (1 << 3), /*!< Include the pixel data */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
841 OrthancPluginDicomToJsonFlags_ConvertBinaryToAscii = (1 << 4), /*!< Output binary tags as-is, dropping non-ASCII */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
842 OrthancPluginDicomToJsonFlags_ConvertBinaryToNull = (1 << 5), /*!< Signal binary tags as null values */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
843 OrthancPluginDicomToJsonFlags_StopAfterPixelData = (1 << 6), /*!< Stop processing after pixel data (new in 1.9.1) */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
844 OrthancPluginDicomToJsonFlags_SkipGroupLengths = (1 << 7), /*!< Skip tags whose element is zero (new in 1.9.1) */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
845
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
846 _OrthancPluginDicomToJsonFlags_INTERNAL = 0x7fffffff
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
847 } OrthancPluginDicomToJsonFlags;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
848
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
849
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
850 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
851 * Flags to the creation of a DICOM file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
852 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
853 * @see OrthancPluginCreateDicom()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
854 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
855 typedef enum
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
856 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
857 OrthancPluginCreateDicomFlags_None = 0,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
858 OrthancPluginCreateDicomFlags_DecodeDataUriScheme = (1 << 0), /*!< Decode fields encoded using data URI scheme */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
859 OrthancPluginCreateDicomFlags_GenerateIdentifiers = (1 << 1), /*!< Automatically generate DICOM identifiers */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
860
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
861 _OrthancPluginCreateDicomFlags_INTERNAL = 0x7fffffff
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
862 } OrthancPluginCreateDicomFlags;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
863
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
864
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
865 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
866 * The constraints on the DICOM identifiers that must be supported
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
867 * by the database plugins.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
868 * @deprecated Plugins using OrthancPluginConstraintType will be faster
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
869 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
870 typedef enum
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
871 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
872 OrthancPluginIdentifierConstraint_Equal = 1, /*!< Equal */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
873 OrthancPluginIdentifierConstraint_SmallerOrEqual = 2, /*!< Less or equal */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
874 OrthancPluginIdentifierConstraint_GreaterOrEqual = 3, /*!< More or equal */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
875 OrthancPluginIdentifierConstraint_Wildcard = 4, /*!< Case-sensitive wildcard matching (with * and ?) */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
876
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
877 _OrthancPluginIdentifierConstraint_INTERNAL = 0x7fffffff
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
878 } OrthancPluginIdentifierConstraint;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
879
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
880
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
881 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
882 * The constraints on the tags (main DICOM tags and identifier tags)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
883 * that must be supported by the database plugins.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
884 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
885 typedef enum
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
886 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
887 OrthancPluginConstraintType_Equal = 1, /*!< Equal */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
888 OrthancPluginConstraintType_SmallerOrEqual = 2, /*!< Less or equal */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
889 OrthancPluginConstraintType_GreaterOrEqual = 3, /*!< More or equal */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
890 OrthancPluginConstraintType_Wildcard = 4, /*!< Wildcard matching */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
891 OrthancPluginConstraintType_List = 5, /*!< List of values */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
892
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
893 _OrthancPluginConstraintType_INTERNAL = 0x7fffffff
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
894 } OrthancPluginConstraintType;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
895
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
896
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
897 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
898 * The origin of a DICOM instance that has been received by Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
899 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
900 typedef enum
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
901 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
902 OrthancPluginInstanceOrigin_Unknown = 1, /*!< Unknown origin */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
903 OrthancPluginInstanceOrigin_DicomProtocol = 2, /*!< Instance received through DICOM protocol */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
904 OrthancPluginInstanceOrigin_RestApi = 3, /*!< Instance received through REST API of Orthanc */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
905 OrthancPluginInstanceOrigin_Plugin = 4, /*!< Instance added to Orthanc by a plugin */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
906 OrthancPluginInstanceOrigin_Lua = 5, /*!< Instance added to Orthanc by a Lua script */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
907 OrthancPluginInstanceOrigin_WebDav = 6, /*!< Instance received through WebDAV (new in 1.8.0) */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
908
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
909 _OrthancPluginInstanceOrigin_INTERNAL = 0x7fffffff
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
910 } OrthancPluginInstanceOrigin;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
911
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
912
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
913 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
914 * The possible status for one single step of a job.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
915 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
916 typedef enum
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
917 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
918 OrthancPluginJobStepStatus_Success = 1, /*!< The job has successfully executed all its steps */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
919 OrthancPluginJobStepStatus_Failure = 2, /*!< The job has failed while executing this step */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
920 OrthancPluginJobStepStatus_Continue = 3 /*!< The job has still data to process after this step */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
921 } OrthancPluginJobStepStatus;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
922
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
923
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
924 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
925 * Explains why the job should stop and release the resources it has
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
926 * allocated. This is especially important to disambiguate between
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
927 * the "paused" condition and the "final" conditions (success,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
928 * failure, or canceled).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
929 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
930 typedef enum
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
931 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
932 OrthancPluginJobStopReason_Success = 1, /*!< The job has succeeded */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
933 OrthancPluginJobStopReason_Paused = 2, /*!< The job was paused, and will be resumed later */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
934 OrthancPluginJobStopReason_Failure = 3, /*!< The job has failed, and might be resubmitted later */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
935 OrthancPluginJobStopReason_Canceled = 4 /*!< The job was canceled, and might be resubmitted later */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
936 } OrthancPluginJobStopReason;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
937
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
938
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
939 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
940 * The available types of metrics.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
941 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
942 typedef enum
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
943 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
944 OrthancPluginMetricsType_Default = 0, /*!< Default metrics */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
945
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
946 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
947 * This metrics represents a time duration. Orthanc will keep the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
948 * maximum value of the metrics over a sliding window of ten
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
949 * seconds, which is useful if the metrics is sampled frequently.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
950 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
951 OrthancPluginMetricsType_Timer = 1
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
952 } OrthancPluginMetricsType;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
953
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
954
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
955 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
956 * The available modes to export a binary DICOM tag into a DICOMweb
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
957 * JSON or XML document.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
958 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
959 typedef enum
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
960 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
961 OrthancPluginDicomWebBinaryMode_Ignore = 0, /*!< Don't include binary tags */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
962 OrthancPluginDicomWebBinaryMode_InlineBinary = 1, /*!< Inline encoding using Base64 */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
963 OrthancPluginDicomWebBinaryMode_BulkDataUri = 2 /*!< Use a bulk data URI field */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
964 } OrthancPluginDicomWebBinaryMode;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
965
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
966
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
967 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
968 * The available values for the Failure Reason (0008,1197) during
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
969 * storage commitment.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
970 * http://dicom.nema.org/medical/dicom/2019e/output/chtml/part03/sect_C.14.html#sect_C.14.1.1
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
971 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
972 typedef enum
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
973 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
974 OrthancPluginStorageCommitmentFailureReason_Success = 0,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
975 /*!< Success: The DICOM instance is properly stored in the SCP */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
976
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
977 OrthancPluginStorageCommitmentFailureReason_ProcessingFailure = 1,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
978 /*!< 0110H: A general failure in processing the operation was encountered */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
979
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
980 OrthancPluginStorageCommitmentFailureReason_NoSuchObjectInstance = 2,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
981 /*!< 0112H: One or more of the elements in the Referenced SOP
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
982 Instance Sequence was not available */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
983
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
984 OrthancPluginStorageCommitmentFailureReason_ResourceLimitation = 3,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
985 /*!< 0213H: The SCP does not currently have enough resources to
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
986 store the requested SOP Instance(s) */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
987
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
988 OrthancPluginStorageCommitmentFailureReason_ReferencedSOPClassNotSupported = 4,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
989 /*!< 0122H: Storage Commitment has been requested for a SOP
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
990 Instance with a SOP Class that is not supported by the SCP */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
991
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
992 OrthancPluginStorageCommitmentFailureReason_ClassInstanceConflict = 5,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
993 /*!< 0119H: The SOP Class of an element in the Referenced SOP
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
994 Instance Sequence did not correspond to the SOP class registered
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
995 for this SOP Instance at the SCP */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
996
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
997 OrthancPluginStorageCommitmentFailureReason_DuplicateTransactionUID = 6
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
998 /*!< 0131H: The Transaction UID of the Storage Commitment Request
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
999 is already in use */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1000 } OrthancPluginStorageCommitmentFailureReason;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1001
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1002
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1003
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1004 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1005 * @brief A 32-bit memory buffer allocated by the core system of Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1006 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1007 * A memory buffer allocated by the core system of Orthanc. When the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1008 * content of the buffer is not useful anymore, it must be free by a
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1009 * call to ::OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1010 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1011 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1012 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1013 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1014 * @brief The content of the buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1015 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1016 void* data;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1017
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1018 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1019 * @brief The number of bytes in the buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1020 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1021 uint32_t size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1022 } OrthancPluginMemoryBuffer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1023
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1024
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1025
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1026 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1027 * @brief A 64-bit memory buffer allocated by the core system of Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1028 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1029 * A memory buffer allocated by the core system of Orthanc. When the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1030 * content of the buffer is not useful anymore, it must be free by a
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1031 * call to ::OrthancPluginFreeMemoryBuffer64().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1032 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1033 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1034 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1035 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1036 * @brief The content of the buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1037 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1038 void* data;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1039
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1040 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1041 * @brief The number of bytes in the buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1042 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1043 uint64_t size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1044 } OrthancPluginMemoryBuffer64;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1045
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1046
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1047
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1048
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1049 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1050 * @brief Opaque structure that represents the HTTP connection to the client application.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1051 * @ingroup Callback
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1052 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1053 typedef struct _OrthancPluginRestOutput_t OrthancPluginRestOutput;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1054
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1055
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1056
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1057 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1058 * @brief Opaque structure that represents a DICOM instance that is managed by the Orthanc core.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1059 * @ingroup DicomInstance
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1060 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1061 typedef struct _OrthancPluginDicomInstance_t OrthancPluginDicomInstance;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1062
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1063
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1064
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1065 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1066 * @brief Opaque structure that represents an image that is uncompressed in memory.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1067 * @ingroup Images
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1068 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1069 typedef struct _OrthancPluginImage_t OrthancPluginImage;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1070
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1071
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1072
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1073 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1074 * @brief Opaque structure that represents the storage area that is actually used by Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1075 * @ingroup Images
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1076 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1077 typedef struct _OrthancPluginStorageArea_t OrthancPluginStorageArea;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1078
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1079
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1080
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1081 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1082 * @brief Opaque structure to an object that represents a C-Find query for worklists.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1083 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1084 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1085 typedef struct _OrthancPluginWorklistQuery_t OrthancPluginWorklistQuery;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1086
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1087
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1088
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1089 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1090 * @brief Opaque structure to an object that represents the answers to a C-Find query for worklists.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1091 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1092 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1093 typedef struct _OrthancPluginWorklistAnswers_t OrthancPluginWorklistAnswers;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1094
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1095
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1096
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1097 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1098 * @brief Opaque structure to an object that represents a C-Find query.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1099 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1100 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1101 typedef struct _OrthancPluginFindQuery_t OrthancPluginFindQuery;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1102
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1103
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1104
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1105 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1106 * @brief Opaque structure to an object that represents the answers to a C-Find query for worklists.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1107 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1108 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1109 typedef struct _OrthancPluginFindAnswers_t OrthancPluginFindAnswers;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1110
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1111
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1112
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1113 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1114 * @brief Opaque structure to an object that can be used to check whether a DICOM instance matches a C-Find query.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1115 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1116 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1117 typedef struct _OrthancPluginFindMatcher_t OrthancPluginFindMatcher;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1118
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1119
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1120
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1121 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1122 * @brief Opaque structure to the set of remote Orthanc Peers that are known to the local Orthanc server.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1123 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1124 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1125 typedef struct _OrthancPluginPeers_t OrthancPluginPeers;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1126
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1127
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1128
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1129 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1130 * @brief Opaque structure to a job to be executed by Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1131 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1132 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1133 typedef struct _OrthancPluginJob_t OrthancPluginJob;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1134
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1135
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1136
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1137 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1138 * @brief Opaque structure that represents a node in a JSON or XML
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1139 * document used in DICOMweb.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1140 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1141 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1142 typedef struct _OrthancPluginDicomWebNode_t OrthancPluginDicomWebNode;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1143
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1144
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1145
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1146 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1147 * @brief Signature of a callback function that answers to a REST request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1148 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1149 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1150 typedef OrthancPluginErrorCode (*OrthancPluginRestCallback) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1151 OrthancPluginRestOutput* output,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1152 const char* url,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1153 const OrthancPluginHttpRequest* request);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1154
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1155
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1156
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1157 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1158 * @brief Signature of a callback function that is triggered when Orthanc stores a new DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1159 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1160 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1161 typedef OrthancPluginErrorCode (*OrthancPluginOnStoredInstanceCallback) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1162 const OrthancPluginDicomInstance* instance,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1163 const char* instanceId);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1164
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1165
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1166
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1167 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1168 * @brief Signature of a callback function that is triggered when a change happens to some DICOM resource.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1169 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1170 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1171 typedef OrthancPluginErrorCode (*OrthancPluginOnChangeCallback) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1172 OrthancPluginChangeType changeType,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1173 OrthancPluginResourceType resourceType,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1174 const char* resourceId);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1175
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1176
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1177
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1178 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1179 * @brief Signature of a callback function to decode a DICOM instance as an image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1180 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1181 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1182 typedef OrthancPluginErrorCode (*OrthancPluginDecodeImageCallback) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1183 OrthancPluginImage** target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1184 const void* dicom,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1185 const uint32_t size,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1186 uint32_t frameIndex);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1187
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1188
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1189
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1190 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1191 * @brief Signature of a function to free dynamic memory.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1192 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1193 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1194 typedef void (*OrthancPluginFree) (void* buffer);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1195
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1196
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1197
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1198 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1199 * @brief Signature of a function to set the content of a node
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1200 * encoding a binary DICOM tag, into a JSON or XML document
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1201 * generated for DICOMweb.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1202 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1203 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1204 typedef void (*OrthancPluginDicomWebSetBinaryNode) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1205 OrthancPluginDicomWebNode* node,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1206 OrthancPluginDicomWebBinaryMode mode,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1207 const char* bulkDataUri);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1208
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1209
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1210
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1211 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1212 * @brief Callback for writing to the storage area.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1213 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1214 * Signature of a callback function that is triggered when Orthanc writes a file to the storage area.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1215 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1216 * @param uuid The UUID of the file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1217 * @param content The content of the file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1218 * @param size The size of the file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1219 * @param type The content type corresponding to this file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1220 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1221 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1222 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1223 typedef OrthancPluginErrorCode (*OrthancPluginStorageCreate) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1224 const char* uuid,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1225 const void* content,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1226 int64_t size,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1227 OrthancPluginContentType type);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1228
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1229
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1230
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1231 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1232 * @brief Callback for reading from the storage area.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1233 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1234 * Signature of a callback function that is triggered when Orthanc reads a file from the storage area.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1235 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1236 * @param content The content of the file (output).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1237 * @param size The size of the file (output).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1238 * @param uuid The UUID of the file of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1239 * @param type The content type corresponding to this file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1240 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1241 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1242 * @deprecated New plugins should use OrthancPluginStorageRead2
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1243 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1244 * @warning The "content" buffer *must* have been allocated using
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1245 * the "malloc()" function of your C standard library (i.e. nor
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1246 * "new[]", neither a pointer to a buffer). The "free()" function of
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1247 * your C standard library will automatically be invoked on the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1248 * "content" pointer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1249 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1250 typedef OrthancPluginErrorCode (*OrthancPluginStorageRead) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1251 void** content,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1252 int64_t* size,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1253 const char* uuid,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1254 OrthancPluginContentType type);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1255
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1256
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1257
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1258 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1259 * @brief Callback for reading a whole file from the storage area.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1260 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1261 * Signature of a callback function that is triggered when Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1262 * reads a whole file from the storage area.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1263 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1264 * @param target Memory buffer where to store the content of the file. It must be allocated by the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1265 * plugin using OrthancPluginCreateMemoryBuffer64(). The core of Orthanc will free it.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1266 * @param uuid The UUID of the file of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1267 * @param type The content type corresponding to this file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1268 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1269 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1270 typedef OrthancPluginErrorCode (*OrthancPluginStorageReadWhole) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1271 OrthancPluginMemoryBuffer64* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1272 const char* uuid,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1273 OrthancPluginContentType type);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1274
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1275
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1276
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1277 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1278 * @brief Callback for reading a range of a file from the storage area.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1279 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1280 * Signature of a callback function that is triggered when Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1281 * reads a portion of a file from the storage area. Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1282 * indicates the start position and the length of the range.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1283 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1284 * @param target Memory buffer where to store the content of the range.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1285 * The memory buffer is allocated and freed by Orthanc. The length of the range
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1286 * of interest corresponds to the size of this buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1287 * @param uuid The UUID of the file of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1288 * @param type The content type corresponding to this file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1289 * @param rangeStart Start position of the requested range in the file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1290 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1291 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1292 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1293 typedef OrthancPluginErrorCode (*OrthancPluginStorageReadRange) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1294 OrthancPluginMemoryBuffer64* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1295 const char* uuid,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1296 OrthancPluginContentType type,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1297 uint64_t rangeStart);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1298
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1299
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1300
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1301 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1302 * @brief Callback for removing a file from the storage area.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1303 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1304 * Signature of a callback function that is triggered when Orthanc deletes a file from the storage area.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1305 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1306 * @param uuid The UUID of the file to be removed.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1307 * @param type The content type corresponding to this file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1308 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1309 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1310 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1311 typedef OrthancPluginErrorCode (*OrthancPluginStorageRemove) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1312 const char* uuid,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1313 OrthancPluginContentType type);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1314
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1315
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1316
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1317 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1318 * @brief Callback to handle the C-Find SCP requests for worklists.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1319 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1320 * Signature of a callback function that is triggered when Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1321 * receives a C-Find SCP request against modality worklists.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1322 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1323 * @param answers The target structure where answers must be stored.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1324 * @param query The worklist query.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1325 * @param issuerAet The Application Entity Title (AET) of the modality from which the request originates.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1326 * @param calledAet The Application Entity Title (AET) of the modality that is called by the request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1327 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1328 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1329 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1330 typedef OrthancPluginErrorCode (*OrthancPluginWorklistCallback) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1331 OrthancPluginWorklistAnswers* answers,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1332 const OrthancPluginWorklistQuery* query,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1333 const char* issuerAet,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1334 const char* calledAet);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1335
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1336
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1337
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1338 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1339 * @brief Callback to filter incoming HTTP requests received by Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1340 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1341 * Signature of a callback function that is triggered whenever
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1342 * Orthanc receives an HTTP/REST request, and that answers whether
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1343 * this request should be allowed. If the callback returns "0"
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1344 * ("false"), the server answers with HTTP status code 403
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1345 * (Forbidden).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1346 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1347 * Pay attention to the fact that this function may be invoked
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1348 * concurrently by different threads of the Web server of
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1349 * Orthanc. You must implement proper locking if applicable.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1350 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1351 * @param method The HTTP method used by the request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1352 * @param uri The URI of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1353 * @param ip The IP address of the HTTP client.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1354 * @param headersCount The number of HTTP headers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1355 * @param headersKeys The keys of the HTTP headers (always converted to low-case).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1356 * @param headersValues The values of the HTTP headers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1357 * @return 0 if forbidden access, 1 if allowed access, -1 if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1358 * @ingroup Callback
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1359 * @deprecated Please instead use OrthancPluginIncomingHttpRequestFilter2()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1360 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1361 typedef int32_t (*OrthancPluginIncomingHttpRequestFilter) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1362 OrthancPluginHttpMethod method,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1363 const char* uri,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1364 const char* ip,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1365 uint32_t headersCount,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1366 const char* const* headersKeys,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1367 const char* const* headersValues);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1368
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1369
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1370
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1371 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1372 * @brief Callback to filter incoming HTTP requests received by Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1373 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1374 * Signature of a callback function that is triggered whenever
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1375 * Orthanc receives an HTTP/REST request, and that answers whether
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1376 * this request should be allowed. If the callback returns "0"
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1377 * ("false"), the server answers with HTTP status code 403
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1378 * (Forbidden).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1379 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1380 * Pay attention to the fact that this function may be invoked
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1381 * concurrently by different threads of the Web server of
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1382 * Orthanc. You must implement proper locking if applicable.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1383 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1384 * @param method The HTTP method used by the request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1385 * @param uri The URI of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1386 * @param ip The IP address of the HTTP client.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1387 * @param headersCount The number of HTTP headers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1388 * @param headersKeys The keys of the HTTP headers (always converted to low-case).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1389 * @param headersValues The values of the HTTP headers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1390 * @param getArgumentsCount The number of GET arguments (only for the GET HTTP method).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1391 * @param getArgumentsKeys The keys of the GET arguments (only for the GET HTTP method).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1392 * @param getArgumentsValues The values of the GET arguments (only for the GET HTTP method).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1393 * @return 0 if forbidden access, 1 if allowed access, -1 if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1394 * @ingroup Callback
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1395 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1396 typedef int32_t (*OrthancPluginIncomingHttpRequestFilter2) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1397 OrthancPluginHttpMethod method,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1398 const char* uri,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1399 const char* ip,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1400 uint32_t headersCount,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1401 const char* const* headersKeys,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1402 const char* const* headersValues,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1403 uint32_t getArgumentsCount,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1404 const char* const* getArgumentsKeys,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1405 const char* const* getArgumentsValues);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1406
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1407
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1408
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1409 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1410 * @brief Callback to handle incoming C-Find SCP requests.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1411 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1412 * Signature of a callback function that is triggered whenever
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1413 * Orthanc receives a C-Find SCP request not concerning modality
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1414 * worklists.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1415 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1416 * @param answers The target structure where answers must be stored.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1417 * @param query The worklist query.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1418 * @param issuerAet The Application Entity Title (AET) of the modality from which the request originates.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1419 * @param calledAet The Application Entity Title (AET) of the modality that is called by the request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1420 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1421 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1422 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1423 typedef OrthancPluginErrorCode (*OrthancPluginFindCallback) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1424 OrthancPluginFindAnswers* answers,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1425 const OrthancPluginFindQuery* query,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1426 const char* issuerAet,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1427 const char* calledAet);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1428
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1429
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1430
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1431 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1432 * @brief Callback to handle incoming C-Move SCP requests.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1433 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1434 * Signature of a callback function that is triggered whenever
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1435 * Orthanc receives a C-Move SCP request. The callback receives the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1436 * type of the resource of interest (study, series, instance...)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1437 * together with the DICOM tags containing its identifiers. In turn,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1438 * the plugin must create a driver object that will be responsible
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1439 * for driving the successive move suboperations.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1440 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1441 * @param resourceType The type of the resource of interest. Note
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1442 * that this might be set to ResourceType_None if the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1443 * QueryRetrieveLevel (0008,0052) tag was not provided by the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1444 * issuer (i.e. the originator modality).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1445 * @param patientId Content of the PatientID (0x0010, 0x0020) tag of the resource of interest. Might be NULL.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1446 * @param accessionNumber Content of the AccessionNumber (0x0008, 0x0050) tag. Might be NULL.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1447 * @param studyInstanceUid Content of the StudyInstanceUID (0x0020, 0x000d) tag. Might be NULL.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1448 * @param seriesInstanceUid Content of the SeriesInstanceUID (0x0020, 0x000e) tag. Might be NULL.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1449 * @param sopInstanceUid Content of the SOPInstanceUID (0x0008, 0x0018) tag. Might be NULL.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1450 * @param originatorAet The Application Entity Title (AET) of the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1451 * modality from which the request originates.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1452 * @param sourceAet The Application Entity Title (AET) of the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1453 * modality that should send its DICOM files to another modality.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1454 * @param targetAet The Application Entity Title (AET) of the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1455 * modality that should receive the DICOM files.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1456 * @param originatorId The Message ID issued by the originator modality,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1457 * as found in tag (0000,0110) of the DICOM query emitted by the issuer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1458 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1459 * @return The NULL value if the plugin cannot deal with this query,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1460 * or a pointer to the driver object that is responsible for
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1461 * handling the successive move suboperations.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1462 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1463 * @note If targetAet equals sourceAet, this is actually a query/retrieve operation.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1464 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1465 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1466 typedef void* (*OrthancPluginMoveCallback) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1467 OrthancPluginResourceType resourceType,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1468 const char* patientId,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1469 const char* accessionNumber,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1470 const char* studyInstanceUid,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1471 const char* seriesInstanceUid,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1472 const char* sopInstanceUid,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1473 const char* originatorAet,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1474 const char* sourceAet,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1475 const char* targetAet,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1476 uint16_t originatorId);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1477
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1478
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1479 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1480 * @brief Callback to read the size of a C-Move driver.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1481 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1482 * Signature of a callback function that returns the number of
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1483 * C-Move suboperations that are to be achieved by the given C-Move
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1484 * driver. This driver is the return value of a previous call to the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1485 * OrthancPluginMoveCallback() callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1486 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1487 * @param moveDriver The C-Move driver of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1488 * @return The number of suboperations.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1489 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1490 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1491 typedef uint32_t (*OrthancPluginGetMoveSize) (void* moveDriver);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1492
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1493
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1494 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1495 * @brief Callback to apply one C-Move suboperation.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1496 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1497 * Signature of a callback function that applies the next C-Move
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1498 * suboperation that os to be achieved by the given C-Move
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1499 * driver. This driver is the return value of a previous call to the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1500 * OrthancPluginMoveCallback() callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1501 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1502 * @param moveDriver The C-Move driver of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1503 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1504 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1505 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1506 typedef OrthancPluginErrorCode (*OrthancPluginApplyMove) (void* moveDriver);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1507
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1508
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1509 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1510 * @brief Callback to free one C-Move driver.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1511 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1512 * Signature of a callback function that releases the resources
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1513 * allocated by the given C-Move driver. This driver is the return
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1514 * value of a previous call to the OrthancPluginMoveCallback()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1515 * callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1516 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1517 * @param moveDriver The C-Move driver of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1518 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1519 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1520 typedef void (*OrthancPluginFreeMove) (void* moveDriver);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1521
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1522
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1523 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1524 * @brief Callback to finalize one custom job.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1525 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1526 * Signature of a callback function that releases all the resources
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1527 * allocated by the given job. This job is the argument provided to
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1528 * OrthancPluginCreateJob().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1529 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1530 * @param job The job of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1531 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1532 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1533 typedef void (*OrthancPluginJobFinalize) (void* job);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1534
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1535
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1536 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1537 * @brief Callback to check the progress of one custom job.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1538 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1539 * Signature of a callback function that returns the progress of the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1540 * job.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1541 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1542 * @param job The job of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1543 * @return The progress, as a floating-point number ranging from 0 to 1.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1544 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1545 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1546 typedef float (*OrthancPluginJobGetProgress) (void* job);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1547
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1548
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1549 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1550 * @brief Callback to retrieve the content of one custom job.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1551 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1552 * Signature of a callback function that returns human-readable
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1553 * statistics about the job. This statistics must be formatted as a
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1554 * JSON object. This information is notably displayed in the "Jobs"
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1555 * tab of "Orthanc Explorer".
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1556 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1557 * @param job The job of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1558 * @return The statistics, as a JSON object encoded as a string.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1559 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1560 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1561 typedef const char* (*OrthancPluginJobGetContent) (void* job);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1562
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1563
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1564 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1565 * @brief Callback to serialize one custom job.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1566 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1567 * Signature of a callback function that returns a serialized
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1568 * version of the job, formatted as a JSON object. This
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1569 * serialization is stored in the Orthanc database, and is used to
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1570 * reload the job on the restart of Orthanc. The "unserialization"
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1571 * callback (with OrthancPluginJobsUnserializer signature) will
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1572 * receive this serialized object.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1573 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1574 * @param job The job of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1575 * @return The serialized job, as a JSON object encoded as a string.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1576 * @see OrthancPluginRegisterJobsUnserializer()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1577 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1578 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1579 typedef const char* (*OrthancPluginJobGetSerialized) (void* job);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1580
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1581
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1582 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1583 * @brief Callback to execute one step of a custom job.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1584 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1585 * Signature of a callback function that executes one step in the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1586 * job. The jobs engine of Orthanc will make successive calls to
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1587 * this method, as long as it returns
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1588 * OrthancPluginJobStepStatus_Continue.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1589 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1590 * @param job The job of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1591 * @return The status of execution.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1592 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1593 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1594 typedef OrthancPluginJobStepStatus (*OrthancPluginJobStep) (void* job);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1595
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1596
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1597 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1598 * @brief Callback executed once one custom job leaves the "running" state.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1599 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1600 * Signature of a callback function that is invoked once a job
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1601 * leaves the "running" state. This can happen if the previous call
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1602 * to OrthancPluginJobStep has failed/succeeded, if the host Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1603 * server is being stopped, or if the user manually tags the job as
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1604 * paused/canceled. This callback allows the plugin to free
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1605 * resources allocated for running this custom job (e.g. to stop
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1606 * threads, or to remove temporary files).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1607 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1608 * Note that handling pauses might involves a specific treatment
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1609 * (such a stopping threads, but keeping temporary files on the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1610 * disk). This "paused" situation can be checked by looking at the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1611 * "reason" parameter.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1612 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1613 * @param job The job of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1614 * @param reason The reason for leaving the "running" state.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1615 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1616 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1617 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1618 typedef OrthancPluginErrorCode (*OrthancPluginJobStop) (void* job,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1619 OrthancPluginJobStopReason reason);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1620
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1621
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1622 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1623 * @brief Callback executed once one stopped custom job is started again.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1624 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1625 * Signature of a callback function that is invoked once a job
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1626 * leaves the "failure/canceled" state, to be started again. This
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1627 * function will typically reset the progress to zero. Note that
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1628 * before being actually executed, the job would first be tagged as
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1629 * "pending" in the Orthanc jobs engine.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1630 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1631 * @param job The job of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1632 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1633 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1634 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1635 typedef OrthancPluginErrorCode (*OrthancPluginJobReset) (void* job);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1636
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1637
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1638 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1639 * @brief Callback executed to unserialize a custom job.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1640 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1641 * Signature of a callback function that unserializes a job that was
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1642 * saved in the Orthanc database.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1643 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1644 * @param jobType The type of the job, as provided to OrthancPluginCreateJob().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1645 * @param serialized The serialization of the job, as provided by OrthancPluginJobGetSerialized.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1646 * @return The unserialized job (as created by OrthancPluginCreateJob()), or NULL
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1647 * if this unserializer cannot handle this job type.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1648 * @see OrthancPluginRegisterJobsUnserializer()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1649 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1650 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1651 typedef OrthancPluginJob* (*OrthancPluginJobsUnserializer) (const char* jobType,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1652 const char* serialized);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1653
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1654
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1655
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1656 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1657 * @brief Callback executed to update the metrics of the plugin.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1658 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1659 * Signature of a callback function that is called by Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1660 * whenever a monitoring tool (such as Prometheus) asks the current
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1661 * values of the metrics. This callback gives the plugin a chance to
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1662 * update its metrics, by calling OrthancPluginSetMetricsValue().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1663 * This is typically useful for metrics that are expensive to
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1664 * acquire.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1665 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1666 * @see OrthancPluginRegisterRefreshMetrics()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1667 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1668 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1669 typedef void (*OrthancPluginRefreshMetricsCallback) ();
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1670
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1671
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1672
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1673 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1674 * @brief Callback executed to encode a binary tag in DICOMweb.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1675 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1676 * Signature of a callback function that is called by Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1677 * whenever a DICOM tag that contains a binary value must be written
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1678 * to a JSON or XML node, while a DICOMweb document is being
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1679 * generated. The value representation (VR) of the DICOM tag can be
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1680 * OB, OD, OF, OL, OW, or UN.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1681 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1682 * @see OrthancPluginEncodeDicomWebJson() and OrthancPluginEncodeDicomWebXml()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1683 * @param node The node being generated, as provided by Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1684 * @param setter The setter to be used to encode the content of the node. If
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1685 * the setter is not called, the binary tag is not written to the output document.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1686 * @param levelDepth The depth of the node in the DICOM hierarchy of sequences.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1687 * This parameter gives the number of elements in the "levelTagGroup",
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1688 * "levelTagElement", and "levelIndex" arrays.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1689 * @param levelTagGroup The group of the parent DICOM tags in the hierarchy.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1690 * @param levelTagElement The element of the parent DICOM tags in the hierarchy.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1691 * @param levelIndex The index of the node in the parent sequences of the hierarchy.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1692 * @param tagGroup The group of the DICOM tag of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1693 * @param tagElement The element of the DICOM tag of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1694 * @param vr The value representation of the binary DICOM node.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1695 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1696 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1697 typedef void (*OrthancPluginDicomWebBinaryCallback) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1698 OrthancPluginDicomWebNode* node,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1699 OrthancPluginDicomWebSetBinaryNode setter,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1700 uint32_t levelDepth,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1701 const uint16_t* levelTagGroup,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1702 const uint16_t* levelTagElement,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1703 const uint32_t* levelIndex,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1704 uint16_t tagGroup,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1705 uint16_t tagElement,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1706 OrthancPluginValueRepresentation vr);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1707
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1708
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1709
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1710 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1711 * @brief Callback executed to encode a binary tag in DICOMweb.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1712 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1713 * Signature of a callback function that is called by Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1714 * whenever a DICOM tag that contains a binary value must be written
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1715 * to a JSON or XML node, while a DICOMweb document is being
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1716 * generated. The value representation (VR) of the DICOM tag can be
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1717 * OB, OD, OF, OL, OW, or UN.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1718 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1719 * @see OrthancPluginEncodeDicomWebJson() and OrthancPluginEncodeDicomWebXml()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1720 * @param node The node being generated, as provided by Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1721 * @param setter The setter to be used to encode the content of the node. If
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1722 * the setter is not called, the binary tag is not written to the output document.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1723 * @param levelDepth The depth of the node in the DICOM hierarchy of sequences.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1724 * This parameter gives the number of elements in the "levelTagGroup",
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1725 * "levelTagElement", and "levelIndex" arrays.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1726 * @param levelTagGroup The group of the parent DICOM tags in the hierarchy.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1727 * @param levelTagElement The element of the parent DICOM tags in the hierarchy.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1728 * @param levelIndex The index of the node in the parent sequences of the hierarchy.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1729 * @param tagGroup The group of the DICOM tag of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1730 * @param tagElement The element of the DICOM tag of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1731 * @param vr The value representation of the binary DICOM node.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1732 * @param payload The user payload.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1733 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1734 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1735 typedef void (*OrthancPluginDicomWebBinaryCallback2) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1736 OrthancPluginDicomWebNode* node,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1737 OrthancPluginDicomWebSetBinaryNode setter,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1738 uint32_t levelDepth,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1739 const uint16_t* levelTagGroup,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1740 const uint16_t* levelTagElement,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1741 const uint32_t* levelIndex,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1742 uint16_t tagGroup,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1743 uint16_t tagElement,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1744 OrthancPluginValueRepresentation vr,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1745 void* payload);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1746
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1747
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1748
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1749 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1750 * @brief Data structure that contains information about the Orthanc core.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1751 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1752 typedef struct _OrthancPluginContext_t
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1753 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1754 void* pluginsManager;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1755 const char* orthancVersion;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1756 OrthancPluginFree Free;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1757 OrthancPluginErrorCode (*InvokeService) (struct _OrthancPluginContext_t* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1758 _OrthancPluginService service,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1759 const void* params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1760 } OrthancPluginContext;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1761
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1762
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1763
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1764 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1765 * @brief An entry in the dictionary of DICOM tags.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1766 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1767 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1768 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1769 uint16_t group; /*!< The group of the tag */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1770 uint16_t element; /*!< The element of the tag */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1771 OrthancPluginValueRepresentation vr; /*!< The value representation of the tag */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1772 uint32_t minMultiplicity; /*!< The minimum multiplicity of the tag */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1773 uint32_t maxMultiplicity; /*!< The maximum multiplicity of the tag (0 means arbitrary) */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1774 } OrthancPluginDictionaryEntry;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1775
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1776
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1777
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1778 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1779 * @brief Free a string.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1780 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1781 * Free a string that was allocated by the core system of Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1782 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1783 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1784 * @param str The string to be freed.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1785 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1786 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeString(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1787 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1788 char* str)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1789 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1790 if (str != NULL)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1791 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1792 context->Free(str);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1793 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1794 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1795
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1796
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1797 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1798 * @brief Check that the version of the hosting Orthanc is above a given version.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1799 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1800 * This function checks whether the version of the Orthanc server
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1801 * running this plugin, is above the given version. Contrarily to
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1802 * OrthancPluginCheckVersion(), it is up to the developer of the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1803 * plugin to make sure that all the Orthanc SDK services called by
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1804 * the plugin are actually implemented in the given version of
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1805 * Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1806 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1807 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1808 * @param expectedMajor Expected major version.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1809 * @param expectedMinor Expected minor version.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1810 * @param expectedRevision Expected revision.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1811 * @return 1 if and only if the versions are compatible. If the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1812 * result is 0, the initialization of the plugin should fail.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1813 * @see OrthancPluginCheckVersion
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1814 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1815 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1816 ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersionAdvanced(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1817 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1818 int expectedMajor,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1819 int expectedMinor,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1820 int expectedRevision)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1821 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1822 int major, minor, revision;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1823
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1824 if (sizeof(int32_t) != sizeof(OrthancPluginErrorCode) ||
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1825 sizeof(int32_t) != sizeof(OrthancPluginHttpMethod) ||
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1826 sizeof(int32_t) != sizeof(_OrthancPluginService) ||
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1827 sizeof(int32_t) != sizeof(_OrthancPluginProperty) ||
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1828 sizeof(int32_t) != sizeof(OrthancPluginPixelFormat) ||
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1829 sizeof(int32_t) != sizeof(OrthancPluginContentType) ||
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1830 sizeof(int32_t) != sizeof(OrthancPluginResourceType) ||
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1831 sizeof(int32_t) != sizeof(OrthancPluginChangeType) ||
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1832 sizeof(int32_t) != sizeof(OrthancPluginCompressionType) ||
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1833 sizeof(int32_t) != sizeof(OrthancPluginImageFormat) ||
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1834 sizeof(int32_t) != sizeof(OrthancPluginValueRepresentation) ||
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1835 sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFormat) ||
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1836 sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFlags) ||
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1837 sizeof(int32_t) != sizeof(OrthancPluginCreateDicomFlags) ||
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1838 sizeof(int32_t) != sizeof(OrthancPluginIdentifierConstraint) ||
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1839 sizeof(int32_t) != sizeof(OrthancPluginInstanceOrigin) ||
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1840 sizeof(int32_t) != sizeof(OrthancPluginJobStepStatus) ||
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1841 sizeof(int32_t) != sizeof(OrthancPluginConstraintType) ||
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1842 sizeof(int32_t) != sizeof(OrthancPluginMetricsType) ||
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1843 sizeof(int32_t) != sizeof(OrthancPluginDicomWebBinaryMode) ||
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1844 sizeof(int32_t) != sizeof(OrthancPluginStorageCommitmentFailureReason))
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1845 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1846 /* Mismatch in the size of the enumerations */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1847 return 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1848 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1849
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1850 /* Assume compatibility with the mainline */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1851 if (!strcmp(context->orthancVersion, "mainline"))
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1852 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1853 return 1;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1854 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1855
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1856 /* Parse the version of the Orthanc core */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1857 if (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1858 #ifdef _MSC_VER
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1859 sscanf_s
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1860 #else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1861 sscanf
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1862 #endif
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1863 (context->orthancVersion, "%4d.%4d.%4d", &major, &minor, &revision) != 3)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1864 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1865 return 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1866 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1867
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1868 /* Check the major number of the version */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1869
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1870 if (major > expectedMajor)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1871 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1872 return 1;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1873 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1874
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1875 if (major < expectedMajor)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1876 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1877 return 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1878 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1879
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1880 /* Check the minor number of the version */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1881
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1882 if (minor > expectedMinor)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1883 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1884 return 1;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1885 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1886
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1887 if (minor < expectedMinor)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1888 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1889 return 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1890 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1891
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1892 /* Check the revision number of the version */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1893
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1894 if (revision >= expectedRevision)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1895 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1896 return 1;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1897 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1898 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1899 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1900 return 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1901 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1902 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1903
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1904
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1905 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1906 * @brief Check the compatibility of the plugin wrt. the version of its hosting Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1907 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1908 * This function checks whether the version of the Orthanc server
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1909 * running this plugin, is above the version of the current Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1910 * SDK header. This guarantees that the plugin is compatible with
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1911 * the hosting Orthanc (i.e. it will not call unavailable services).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1912 * The result of this function should always be checked in the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1913 * OrthancPluginInitialize() entry point of the plugin.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1914 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1915 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1916 * @return 1 if and only if the versions are compatible. If the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1917 * result is 0, the initialization of the plugin should fail.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1918 * @see OrthancPluginCheckVersionAdvanced
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1919 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1920 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1921 ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersion(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1922 OrthancPluginContext* context)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1923 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1924 return OrthancPluginCheckVersionAdvanced(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1925 context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1926 ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1927 ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1928 ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1929 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1930
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1931
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1932 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1933 * @brief Free a memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1934 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1935 * Free a memory buffer that was allocated by the core system of Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1936 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1937 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1938 * @param buffer The memory buffer to release.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1939 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1940 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeMemoryBuffer(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1941 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1942 OrthancPluginMemoryBuffer* buffer)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1943 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1944 context->Free(buffer->data);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1945 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1946
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1947
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1948 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1949 * @brief Free a memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1950 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1951 * Free a memory buffer that was allocated by the core system of Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1952 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1953 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1954 * @param buffer The memory buffer to release.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1955 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1956 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeMemoryBuffer64(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1957 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1958 OrthancPluginMemoryBuffer64* buffer)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1959 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1960 context->Free(buffer->data);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1961 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1962
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1963
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1964 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1965 * @brief Log an error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1966 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1967 * Log an error message using the Orthanc logging system.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1968 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1969 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1970 * @param message The message to be logged.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1971 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1972 ORTHANC_PLUGIN_INLINE void OrthancPluginLogError(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1973 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1974 const char* message)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1975 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1976 context->InvokeService(context, _OrthancPluginService_LogError, message);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1977 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1978
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1979
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1980 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1981 * @brief Log a warning.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1982 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1983 * Log a warning message using the Orthanc logging system.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1984 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1985 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1986 * @param message The message to be logged.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1987 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1988 ORTHANC_PLUGIN_INLINE void OrthancPluginLogWarning(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1989 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1990 const char* message)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1991 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1992 context->InvokeService(context, _OrthancPluginService_LogWarning, message);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1993 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1994
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1995
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1996 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1997 * @brief Log an information.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1998 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1999 * Log an information message using the Orthanc logging system.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2000 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2001 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2002 * @param message The message to be logged.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2003 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2004 ORTHANC_PLUGIN_INLINE void OrthancPluginLogInfo(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2005 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2006 const char* message)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2007 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2008 context->InvokeService(context, _OrthancPluginService_LogInfo, message);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2009 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2010
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2011
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2012
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2013 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2014 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2015 const char* pathRegularExpression;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2016 OrthancPluginRestCallback callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2017 } _OrthancPluginRestCallback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2018
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2019 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2020 * @brief Register a REST callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2021 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2022 * This function registers a REST callback against a regular
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2023 * expression for a URI. This function must be called during the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2024 * initialization of the plugin, i.e. inside the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2025 * OrthancPluginInitialize() public function.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2026 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2027 * Each REST callback is guaranteed to run in mutual exclusion.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2028 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2029 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2030 * @param pathRegularExpression Regular expression for the URI. May contain groups.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2031 * @param callback The callback function to handle the REST call.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2032 * @see OrthancPluginRegisterRestCallbackNoLock()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2033 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2034 * @note
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2035 * The regular expression is case sensitive and must follow the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2036 * [Perl syntax](https://www.boost.org/doc/libs/1_67_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2037 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2038 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2039 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2040 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallback(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2041 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2042 const char* pathRegularExpression,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2043 OrthancPluginRestCallback callback)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2044 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2045 _OrthancPluginRestCallback params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2046 params.pathRegularExpression = pathRegularExpression;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2047 params.callback = callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2048 context->InvokeService(context, _OrthancPluginService_RegisterRestCallback, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2049 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2050
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2051
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2052
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2053 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2054 * @brief Register a REST callback, without locking.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2055 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2056 * This function registers a REST callback against a regular
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2057 * expression for a URI. This function must be called during the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2058 * initialization of the plugin, i.e. inside the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2059 * OrthancPluginInitialize() public function.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2060 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2061 * Contrarily to OrthancPluginRegisterRestCallback(), the callback
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2062 * will NOT be invoked in mutual exclusion. This can be useful for
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2063 * high-performance plugins that must handle concurrent requests
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2064 * (Orthanc uses a pool of threads, one thread being assigned to
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2065 * each incoming HTTP request). Of course, if using this function,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2066 * it is up to the plugin to implement the required locking
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2067 * mechanisms.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2068 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2069 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2070 * @param pathRegularExpression Regular expression for the URI. May contain groups.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2071 * @param callback The callback function to handle the REST call.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2072 * @see OrthancPluginRegisterRestCallback()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2073 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2074 * @note
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2075 * The regular expression is case sensitive and must follow the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2076 * [Perl syntax](https://www.boost.org/doc/libs/1_67_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2077 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2078 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2079 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2080 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallbackNoLock(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2081 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2082 const char* pathRegularExpression,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2083 OrthancPluginRestCallback callback)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2084 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2085 _OrthancPluginRestCallback params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2086 params.pathRegularExpression = pathRegularExpression;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2087 params.callback = callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2088 context->InvokeService(context, _OrthancPluginService_RegisterRestCallbackNoLock, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2089 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2090
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2091
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2092
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2093 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2094 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2095 OrthancPluginOnStoredInstanceCallback callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2096 } _OrthancPluginOnStoredInstanceCallback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2097
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2098 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2099 * @brief Register a callback for received instances.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2100 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2101 * This function registers a callback function that is called
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2102 * whenever a new DICOM instance is stored into the Orthanc core.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2103 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2104 * @warning Your callback function will be called synchronously with
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2105 * the core of Orthanc. This implies that deadlocks might emerge if
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2106 * you call other core primitives of Orthanc in your callback (such
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2107 * deadlocks are particular visible in the presence of other plugins
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2108 * or Lua scripts). It is thus strongly advised to avoid any call to
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2109 * the REST API of Orthanc in the callback. If you have to call
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2110 * other primitives of Orthanc, you should make these calls in a
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2111 * separate thread, passing the pending events to be processed
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2112 * through a message queue.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2113 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2114 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2115 * @param callback The callback function.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2116 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2117 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2118 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnStoredInstanceCallback(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2119 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2120 OrthancPluginOnStoredInstanceCallback callback)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2121 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2122 _OrthancPluginOnStoredInstanceCallback params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2123 params.callback = callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2124
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2125 context->InvokeService(context, _OrthancPluginService_RegisterOnStoredInstanceCallback, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2126 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2127
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2128
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2129
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2130 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2131 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2132 OrthancPluginRestOutput* output;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2133 const void* answer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2134 uint32_t answerSize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2135 const char* mimeType;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2136 } _OrthancPluginAnswerBuffer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2137
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2138 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2139 * @brief Answer to a REST request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2140 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2141 * This function answers to a REST request with the content of a memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2142 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2143 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2144 * @param output The HTTP connection to the client application.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2145 * @param answer Pointer to the memory buffer containing the answer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2146 * @param answerSize Number of bytes of the answer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2147 * @param mimeType The MIME type of the answer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2148 * @ingroup REST
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2149 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2150 ORTHANC_PLUGIN_INLINE void OrthancPluginAnswerBuffer(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2151 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2152 OrthancPluginRestOutput* output,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2153 const void* answer,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2154 uint32_t answerSize,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2155 const char* mimeType)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2156 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2157 _OrthancPluginAnswerBuffer params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2158 params.output = output;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2159 params.answer = answer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2160 params.answerSize = answerSize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2161 params.mimeType = mimeType;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2162 context->InvokeService(context, _OrthancPluginService_AnswerBuffer, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2163 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2164
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2165
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2166 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2167 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2168 OrthancPluginRestOutput* output;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2169 OrthancPluginPixelFormat format;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2170 uint32_t width;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2171 uint32_t height;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2172 uint32_t pitch;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2173 const void* buffer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2174 } _OrthancPluginCompressAndAnswerPngImage;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2175
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2176 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2177 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2178 OrthancPluginRestOutput* output;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2179 OrthancPluginImageFormat imageFormat;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2180 OrthancPluginPixelFormat pixelFormat;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2181 uint32_t width;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2182 uint32_t height;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2183 uint32_t pitch;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2184 const void* buffer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2185 uint8_t quality;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2186 } _OrthancPluginCompressAndAnswerImage;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2187
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2188
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2189 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2190 * @brief Answer to a REST request with a PNG image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2191 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2192 * This function answers to a REST request with a PNG image. The
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2193 * parameters of this function describe a memory buffer that
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2194 * contains an uncompressed image. The image will be automatically compressed
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2195 * as a PNG image by the core system of Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2196 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2197 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2198 * @param output The HTTP connection to the client application.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2199 * @param format The memory layout of the uncompressed image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2200 * @param width The width of the image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2201 * @param height The height of the image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2202 * @param pitch The pitch of the image (i.e. the number of bytes
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2203 * between 2 successive lines of the image in the memory buffer).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2204 * @param buffer The memory buffer containing the uncompressed image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2205 * @ingroup REST
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2206 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2207 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerPngImage(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2208 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2209 OrthancPluginRestOutput* output,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2210 OrthancPluginPixelFormat format,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2211 uint32_t width,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2212 uint32_t height,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2213 uint32_t pitch,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2214 const void* buffer)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2215 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2216 _OrthancPluginCompressAndAnswerImage params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2217 params.output = output;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2218 params.imageFormat = OrthancPluginImageFormat_Png;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2219 params.pixelFormat = format;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2220 params.width = width;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2221 params.height = height;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2222 params.pitch = pitch;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2223 params.buffer = buffer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2224 params.quality = 0; /* No quality for PNG */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2225 context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2226 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2227
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2228
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2229
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2230 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2231 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2232 OrthancPluginMemoryBuffer* target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2233 const char* instanceId;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2234 } _OrthancPluginGetDicomForInstance;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2235
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2236 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2237 * @brief Retrieve a DICOM instance using its Orthanc identifier.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2238 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2239 * Retrieve a DICOM instance using its Orthanc identifier. The DICOM
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2240 * file is stored into a newly allocated memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2241 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2242 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2243 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2244 * @param instanceId The Orthanc identifier of the DICOM instance of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2245 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2246 * @ingroup Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2247 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2248 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetDicomForInstance(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2249 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2250 OrthancPluginMemoryBuffer* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2251 const char* instanceId)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2252 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2253 _OrthancPluginGetDicomForInstance params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2254 params.target = target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2255 params.instanceId = instanceId;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2256 return context->InvokeService(context, _OrthancPluginService_GetDicomForInstance, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2257 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2258
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2259
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2260
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2261 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2262 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2263 OrthancPluginMemoryBuffer* target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2264 const char* uri;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2265 } _OrthancPluginRestApiGet;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2266
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2267 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2268 * @brief Make a GET call to the built-in Orthanc REST API.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2269 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2270 * Make a GET call to the built-in Orthanc REST API. The result to
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2271 * the query is stored into a newly allocated memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2272 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2273 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2274 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2275 * @param uri The URI in the built-in Orthanc API.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2276 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2277 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2278 * @see OrthancPluginRestApiGetAfterPlugins
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2279 * @ingroup Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2280 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2281 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2282 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2283 OrthancPluginMemoryBuffer* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2284 const char* uri)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2285 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2286 _OrthancPluginRestApiGet params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2287 params.target = target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2288 params.uri = uri;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2289 return context->InvokeService(context, _OrthancPluginService_RestApiGet, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2290 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2291
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2292
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2293
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2294 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2295 * @brief Make a GET call to the REST API, as tainted by the plugins.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2296 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2297 * Make a GET call to the Orthanc REST API, after all the plugins
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2298 * are applied. In other words, if some plugin overrides or adds the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2299 * called URI to the built-in Orthanc REST API, this call will
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2300 * return the result provided by this plugin. The result to the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2301 * query is stored into a newly allocated memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2302 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2303 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2304 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2305 * @param uri The URI in the built-in Orthanc API.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2306 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2307 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2308 * @see OrthancPluginRestApiGet
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2309 * @ingroup Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2310 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2311 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGetAfterPlugins(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2312 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2313 OrthancPluginMemoryBuffer* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2314 const char* uri)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2315 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2316 _OrthancPluginRestApiGet params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2317 params.target = target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2318 params.uri = uri;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2319 return context->InvokeService(context, _OrthancPluginService_RestApiGetAfterPlugins, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2320 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2321
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2322
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2323
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2324 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2325 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2326 OrthancPluginMemoryBuffer* target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2327 const char* uri;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2328 const void* body;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2329 uint32_t bodySize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2330 } _OrthancPluginRestApiPostPut;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2331
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2332 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2333 * @brief Make a POST call to the built-in Orthanc REST API.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2334 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2335 * Make a POST call to the built-in Orthanc REST API. The result to
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2336 * the query is stored into a newly allocated memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2337 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2338 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2339 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2340 * @param uri The URI in the built-in Orthanc API.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2341 * @param body The body of the POST request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2342 * @param bodySize The size of the body.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2343 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2344 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2345 * @see OrthancPluginRestApiPostAfterPlugins
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2346 * @ingroup Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2347 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2348 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPost(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2349 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2350 OrthancPluginMemoryBuffer* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2351 const char* uri,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2352 const void* body,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2353 uint32_t bodySize)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2354 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2355 _OrthancPluginRestApiPostPut params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2356 params.target = target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2357 params.uri = uri;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2358 params.body = body;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2359 params.bodySize = bodySize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2360 return context->InvokeService(context, _OrthancPluginService_RestApiPost, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2361 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2362
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2363
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2364 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2365 * @brief Make a POST call to the REST API, as tainted by the plugins.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2366 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2367 * Make a POST call to the Orthanc REST API, after all the plugins
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2368 * are applied. In other words, if some plugin overrides or adds the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2369 * called URI to the built-in Orthanc REST API, this call will
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2370 * return the result provided by this plugin. The result to the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2371 * query is stored into a newly allocated memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2372 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2373 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2374 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2375 * @param uri The URI in the built-in Orthanc API.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2376 * @param body The body of the POST request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2377 * @param bodySize The size of the body.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2378 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2379 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2380 * @see OrthancPluginRestApiPost
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2381 * @ingroup Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2382 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2383 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPostAfterPlugins(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2384 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2385 OrthancPluginMemoryBuffer* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2386 const char* uri,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2387 const void* body,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2388 uint32_t bodySize)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2389 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2390 _OrthancPluginRestApiPostPut params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2391 params.target = target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2392 params.uri = uri;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2393 params.body = body;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2394 params.bodySize = bodySize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2395 return context->InvokeService(context, _OrthancPluginService_RestApiPostAfterPlugins, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2396 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2397
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2398
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2399
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2400 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2401 * @brief Make a DELETE call to the built-in Orthanc REST API.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2402 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2403 * Make a DELETE call to the built-in Orthanc REST API.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2404 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2405 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2406 * @param uri The URI to delete in the built-in Orthanc API.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2407 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2408 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2409 * @see OrthancPluginRestApiDeleteAfterPlugins
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2410 * @ingroup Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2411 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2412 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDelete(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2413 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2414 const char* uri)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2415 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2416 return context->InvokeService(context, _OrthancPluginService_RestApiDelete, uri);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2417 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2418
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2419
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2420 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2421 * @brief Make a DELETE call to the REST API, as tainted by the plugins.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2422 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2423 * Make a DELETE call to the Orthanc REST API, after all the plugins
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2424 * are applied. In other words, if some plugin overrides or adds the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2425 * called URI to the built-in Orthanc REST API, this call will
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2426 * return the result provided by this plugin.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2427 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2428 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2429 * @param uri The URI to delete in the built-in Orthanc API.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2430 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2431 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2432 * @see OrthancPluginRestApiDelete
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2433 * @ingroup Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2434 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2435 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDeleteAfterPlugins(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2436 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2437 const char* uri)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2438 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2439 return context->InvokeService(context, _OrthancPluginService_RestApiDeleteAfterPlugins, uri);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2440 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2441
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2442
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2443
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2444 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2445 * @brief Make a PUT call to the built-in Orthanc REST API.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2446 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2447 * Make a PUT call to the built-in Orthanc REST API. The result to
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2448 * the query is stored into a newly allocated memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2449 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2450 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2451 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2452 * @param uri The URI in the built-in Orthanc API.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2453 * @param body The body of the PUT request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2454 * @param bodySize The size of the body.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2455 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2456 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2457 * @see OrthancPluginRestApiPutAfterPlugins
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2458 * @ingroup Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2459 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2460 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPut(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2461 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2462 OrthancPluginMemoryBuffer* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2463 const char* uri,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2464 const void* body,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2465 uint32_t bodySize)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2466 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2467 _OrthancPluginRestApiPostPut params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2468 params.target = target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2469 params.uri = uri;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2470 params.body = body;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2471 params.bodySize = bodySize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2472 return context->InvokeService(context, _OrthancPluginService_RestApiPut, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2473 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2474
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2475
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2476
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2477 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2478 * @brief Make a PUT call to the REST API, as tainted by the plugins.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2479 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2480 * Make a PUT call to the Orthanc REST API, after all the plugins
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2481 * are applied. In other words, if some plugin overrides or adds the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2482 * called URI to the built-in Orthanc REST API, this call will
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2483 * return the result provided by this plugin. The result to the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2484 * query is stored into a newly allocated memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2485 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2486 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2487 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2488 * @param uri The URI in the built-in Orthanc API.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2489 * @param body The body of the PUT request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2490 * @param bodySize The size of the body.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2491 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2492 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2493 * @see OrthancPluginRestApiPut
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2494 * @ingroup Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2495 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2496 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPutAfterPlugins(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2497 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2498 OrthancPluginMemoryBuffer* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2499 const char* uri,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2500 const void* body,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2501 uint32_t bodySize)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2502 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2503 _OrthancPluginRestApiPostPut params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2504 params.target = target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2505 params.uri = uri;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2506 params.body = body;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2507 params.bodySize = bodySize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2508 return context->InvokeService(context, _OrthancPluginService_RestApiPutAfterPlugins, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2509 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2510
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2511
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2512
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2513 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2514 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2515 OrthancPluginRestOutput* output;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2516 const char* argument;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2517 } _OrthancPluginOutputPlusArgument;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2518
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2519 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2520 * @brief Redirect a REST request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2521 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2522 * This function answers to a REST request by redirecting the user
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2523 * to another URI using HTTP status 301.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2524 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2525 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2526 * @param output The HTTP connection to the client application.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2527 * @param redirection Where to redirect.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2528 * @ingroup REST
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2529 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2530 ORTHANC_PLUGIN_INLINE void OrthancPluginRedirect(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2531 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2532 OrthancPluginRestOutput* output,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2533 const char* redirection)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2534 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2535 _OrthancPluginOutputPlusArgument params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2536 params.output = output;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2537 params.argument = redirection;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2538 context->InvokeService(context, _OrthancPluginService_Redirect, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2539 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2540
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2541
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2542
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2543 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2544 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2545 char** result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2546 const char* argument;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2547 } _OrthancPluginRetrieveDynamicString;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2548
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2549 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2550 * @brief Look for a patient.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2551 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2552 * Look for a patient stored in Orthanc, using its Patient ID tag (0x0010, 0x0020).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2553 * This function uses the database index to run as fast as possible (it does not loop
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2554 * over all the stored patients).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2555 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2556 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2557 * @param patientID The Patient ID of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2558 * @return The NULL value if the patient is non-existent, or a string containing the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2559 * Orthanc ID of the patient. This string must be freed by OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2560 * @ingroup Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2561 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2562 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupPatient(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2563 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2564 const char* patientID)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2565 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2566 char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2567
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2568 _OrthancPluginRetrieveDynamicString params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2569 params.result = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2570 params.argument = patientID;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2571
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2572 if (context->InvokeService(context, _OrthancPluginService_LookupPatient, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2573 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2574 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2575 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2576 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2577 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2578 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2579 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2580 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2581 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2582
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2583
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2584 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2585 * @brief Look for a study.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2586 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2587 * Look for a study stored in Orthanc, using its Study Instance UID tag (0x0020, 0x000d).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2588 * This function uses the database index to run as fast as possible (it does not loop
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2589 * over all the stored studies).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2590 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2591 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2592 * @param studyUID The Study Instance UID of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2593 * @return The NULL value if the study is non-existent, or a string containing the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2594 * Orthanc ID of the study. This string must be freed by OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2595 * @ingroup Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2596 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2597 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudy(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2598 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2599 const char* studyUID)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2600 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2601 char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2602
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2603 _OrthancPluginRetrieveDynamicString params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2604 params.result = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2605 params.argument = studyUID;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2606
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2607 if (context->InvokeService(context, _OrthancPluginService_LookupStudy, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2608 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2609 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2610 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2611 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2612 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2613 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2614 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2615 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2616 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2617
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2618
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2619 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2620 * @brief Look for a study, using the accession number.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2621 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2622 * Look for a study stored in Orthanc, using its Accession Number tag (0x0008, 0x0050).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2623 * This function uses the database index to run as fast as possible (it does not loop
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2624 * over all the stored studies).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2625 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2626 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2627 * @param accessionNumber The Accession Number of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2628 * @return The NULL value if the study is non-existent, or a string containing the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2629 * Orthanc ID of the study. This string must be freed by OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2630 * @ingroup Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2631 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2632 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudyWithAccessionNumber(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2633 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2634 const char* accessionNumber)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2635 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2636 char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2637
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2638 _OrthancPluginRetrieveDynamicString params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2639 params.result = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2640 params.argument = accessionNumber;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2641
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2642 if (context->InvokeService(context, _OrthancPluginService_LookupStudyWithAccessionNumber, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2643 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2644 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2645 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2646 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2647 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2648 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2649 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2650 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2651 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2652
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2653
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2654 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2655 * @brief Look for a series.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2656 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2657 * Look for a series stored in Orthanc, using its Series Instance UID tag (0x0020, 0x000e).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2658 * This function uses the database index to run as fast as possible (it does not loop
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2659 * over all the stored series).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2660 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2661 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2662 * @param seriesUID The Series Instance UID of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2663 * @return The NULL value if the series is non-existent, or a string containing the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2664 * Orthanc ID of the series. This string must be freed by OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2665 * @ingroup Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2666 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2667 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupSeries(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2668 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2669 const char* seriesUID)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2670 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2671 char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2672
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2673 _OrthancPluginRetrieveDynamicString params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2674 params.result = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2675 params.argument = seriesUID;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2676
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2677 if (context->InvokeService(context, _OrthancPluginService_LookupSeries, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2678 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2679 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2680 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2681 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2682 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2683 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2684 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2685 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2686 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2687
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2688
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2689 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2690 * @brief Look for an instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2691 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2692 * Look for an instance stored in Orthanc, using its SOP Instance UID tag (0x0008, 0x0018).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2693 * This function uses the database index to run as fast as possible (it does not loop
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2694 * over all the stored instances).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2695 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2696 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2697 * @param sopInstanceUID The SOP Instance UID of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2698 * @return The NULL value if the instance is non-existent, or a string containing the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2699 * Orthanc ID of the instance. This string must be freed by OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2700 * @ingroup Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2701 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2702 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupInstance(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2703 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2704 const char* sopInstanceUID)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2705 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2706 char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2707
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2708 _OrthancPluginRetrieveDynamicString params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2709 params.result = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2710 params.argument = sopInstanceUID;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2711
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2712 if (context->InvokeService(context, _OrthancPluginService_LookupInstance, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2713 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2714 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2715 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2716 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2717 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2718 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2719 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2720 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2721 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2722
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2723
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2724
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2725 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2726 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2727 OrthancPluginRestOutput* output;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2728 uint16_t status;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2729 } _OrthancPluginSendHttpStatusCode;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2730
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2731 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2732 * @brief Send a HTTP status code.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2733 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2734 * This function answers to a REST request by sending a HTTP status
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2735 * code (such as "400 - Bad Request"). Note that:
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2736 * - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2737 * - Redirections (status 301) must use ::OrthancPluginRedirect().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2738 * - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2739 * - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2740 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2741 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2742 * @param output The HTTP connection to the client application.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2743 * @param status The HTTP status code to be sent.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2744 * @ingroup REST
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2745 * @see OrthancPluginSendHttpStatus()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2746 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2747 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatusCode(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2748 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2749 OrthancPluginRestOutput* output,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2750 uint16_t status)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2751 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2752 _OrthancPluginSendHttpStatusCode params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2753 params.output = output;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2754 params.status = status;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2755 context->InvokeService(context, _OrthancPluginService_SendHttpStatusCode, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2756 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2757
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2758
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2759 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2760 * @brief Signal that a REST request is not authorized.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2761 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2762 * This function answers to a REST request by signaling that it is
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2763 * not authorized.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2764 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2765 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2766 * @param output The HTTP connection to the client application.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2767 * @param realm The realm for the authorization process.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2768 * @ingroup REST
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2769 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2770 ORTHANC_PLUGIN_INLINE void OrthancPluginSendUnauthorized(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2771 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2772 OrthancPluginRestOutput* output,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2773 const char* realm)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2774 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2775 _OrthancPluginOutputPlusArgument params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2776 params.output = output;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2777 params.argument = realm;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2778 context->InvokeService(context, _OrthancPluginService_SendUnauthorized, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2779 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2780
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2781
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2782 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2783 * @brief Signal that this URI does not support this HTTP method.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2784 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2785 * This function answers to a REST request by signaling that the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2786 * queried URI does not support this method.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2787 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2788 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2789 * @param output The HTTP connection to the client application.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2790 * @param allowedMethods The allowed methods for this URI (e.g. "GET,POST" after a PUT or a POST request).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2791 * @ingroup REST
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2792 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2793 ORTHANC_PLUGIN_INLINE void OrthancPluginSendMethodNotAllowed(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2794 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2795 OrthancPluginRestOutput* output,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2796 const char* allowedMethods)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2797 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2798 _OrthancPluginOutputPlusArgument params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2799 params.output = output;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2800 params.argument = allowedMethods;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2801 context->InvokeService(context, _OrthancPluginService_SendMethodNotAllowed, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2802 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2803
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2804
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2805 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2806 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2807 OrthancPluginRestOutput* output;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2808 const char* key;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2809 const char* value;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2810 } _OrthancPluginSetHttpHeader;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2811
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2812 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2813 * @brief Set a cookie.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2814 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2815 * This function sets a cookie in the HTTP client.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2816 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2817 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2818 * @param output The HTTP connection to the client application.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2819 * @param cookie The cookie to be set.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2820 * @param value The value of the cookie.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2821 * @ingroup REST
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2822 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2823 ORTHANC_PLUGIN_INLINE void OrthancPluginSetCookie(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2824 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2825 OrthancPluginRestOutput* output,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2826 const char* cookie,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2827 const char* value)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2828 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2829 _OrthancPluginSetHttpHeader params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2830 params.output = output;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2831 params.key = cookie;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2832 params.value = value;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2833 context->InvokeService(context, _OrthancPluginService_SetCookie, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2834 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2835
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2836
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2837 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2838 * @brief Set some HTTP header.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2839 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2840 * This function sets a HTTP header in the HTTP answer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2841 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2842 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2843 * @param output The HTTP connection to the client application.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2844 * @param key The HTTP header to be set.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2845 * @param value The value of the HTTP header.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2846 * @ingroup REST
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2847 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2848 ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpHeader(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2849 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2850 OrthancPluginRestOutput* output,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2851 const char* key,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2852 const char* value)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2853 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2854 _OrthancPluginSetHttpHeader params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2855 params.output = output;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2856 params.key = key;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2857 params.value = value;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2858 context->InvokeService(context, _OrthancPluginService_SetHttpHeader, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2859 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2860
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2861
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2862 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2863 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2864 char** resultStringToFree;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2865 const char** resultString;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2866 int64_t* resultInt64;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2867 const char* key;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2868 const OrthancPluginDicomInstance* instance;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2869 OrthancPluginInstanceOrigin* resultOrigin; /* New in Orthanc 0.9.5 SDK */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2870 } _OrthancPluginAccessDicomInstance;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2871
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2872
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2873 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2874 * @brief Get the AET of a DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2875 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2876 * This function returns the Application Entity Title (AET) of the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2877 * DICOM modality from which a DICOM instance originates.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2878 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2879 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2880 * @param instance The instance of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2881 * @return The AET if success, NULL if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2882 * @ingroup DicomInstance
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2883 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2884 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceRemoteAet(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2885 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2886 const OrthancPluginDicomInstance* instance)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2887 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2888 const char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2889
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2890 _OrthancPluginAccessDicomInstance params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2891 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2892 params.resultString = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2893 params.instance = instance;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2894
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2895 if (context->InvokeService(context, _OrthancPluginService_GetInstanceRemoteAet, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2896 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2897 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2898 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2899 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2900 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2901 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2902 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2903 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2904 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2905
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2906
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2907 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2908 * @brief Get the size of a DICOM file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2909 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2910 * This function returns the number of bytes of the given DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2911 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2912 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2913 * @param instance The instance of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2914 * @return The size of the file, -1 in case of error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2915 * @ingroup DicomInstance
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2916 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2917 ORTHANC_PLUGIN_INLINE int64_t OrthancPluginGetInstanceSize(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2918 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2919 const OrthancPluginDicomInstance* instance)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2920 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2921 int64_t size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2922
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2923 _OrthancPluginAccessDicomInstance params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2924 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2925 params.resultInt64 = &size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2926 params.instance = instance;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2927
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2928 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSize, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2929 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2930 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2931 return -1;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2932 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2933 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2934 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2935 return size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2936 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2937 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2938
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2939
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2940 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2941 * @brief Get the data of a DICOM file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2942 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2943 * This function returns a pointer to the content of the given DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2944 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2945 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2946 * @param instance The instance of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2947 * @return The pointer to the DICOM data, NULL in case of error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2948 * @ingroup DicomInstance
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2949 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2950 ORTHANC_PLUGIN_INLINE const void* OrthancPluginGetInstanceData(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2951 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2952 const OrthancPluginDicomInstance* instance)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2953 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2954 const char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2955
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2956 _OrthancPluginAccessDicomInstance params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2957 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2958 params.resultString = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2959 params.instance = instance;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2960
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2961 if (context->InvokeService(context, _OrthancPluginService_GetInstanceData, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2962 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2963 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2964 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2965 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2966 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2967 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2968 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2969 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2970 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2971
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2972
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2973 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2974 * @brief Get the DICOM tag hierarchy as a JSON file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2975 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2976 * This function returns a pointer to a newly created string
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2977 * containing a JSON file. This JSON file encodes the tag hierarchy
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2978 * of the given DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2979 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2980 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2981 * @param instance The instance of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2982 * @return The NULL value in case of error, or a string containing the JSON file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2983 * This string must be freed by OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2984 * @ingroup DicomInstance
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2985 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2986 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceJson(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2987 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2988 const OrthancPluginDicomInstance* instance)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2989 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2990 char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2991
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2992 _OrthancPluginAccessDicomInstance params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2993 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2994 params.resultStringToFree = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2995 params.instance = instance;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2996
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2997 if (context->InvokeService(context, _OrthancPluginService_GetInstanceJson, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2998 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2999 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3000 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3001 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3002 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3003 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3004 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3005 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3006 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3007
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3008
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3009 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3010 * @brief Get the DICOM tag hierarchy as a JSON file (with simplification).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3011 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3012 * This function returns a pointer to a newly created string
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3013 * containing a JSON file. This JSON file encodes the tag hierarchy
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3014 * of the given DICOM instance. In contrast with
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3015 * ::OrthancPluginGetInstanceJson(), the returned JSON file is in
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3016 * its simplified version.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3017 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3018 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3019 * @param instance The instance of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3020 * @return The NULL value in case of error, or a string containing the JSON file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3021 * This string must be freed by OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3022 * @ingroup DicomInstance
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3023 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3024 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceSimplifiedJson(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3025 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3026 const OrthancPluginDicomInstance* instance)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3027 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3028 char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3029
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3030 _OrthancPluginAccessDicomInstance params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3031 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3032 params.resultStringToFree = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3033 params.instance = instance;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3034
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3035 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSimplifiedJson, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3036 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3037 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3038 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3039 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3040 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3041 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3042 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3043 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3044 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3045
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3046
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3047 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3048 * @brief Check whether a DICOM instance is associated with some metadata.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3049 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3050 * This function checks whether the DICOM instance of interest is
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3051 * associated with some metadata. As of Orthanc 0.8.1, in the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3052 * callbacks registered by
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3053 * ::OrthancPluginRegisterOnStoredInstanceCallback(), the only
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3054 * possibly available metadata are "ReceptionDate", "RemoteAET" and
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3055 * "IndexInSeries".
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3056 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3057 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3058 * @param instance The instance of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3059 * @param metadata The metadata of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3060 * @return 1 if the metadata is present, 0 if it is absent, -1 in case of error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3061 * @ingroup DicomInstance
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3062 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3063 ORTHANC_PLUGIN_INLINE int OrthancPluginHasInstanceMetadata(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3064 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3065 const OrthancPluginDicomInstance* instance,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3066 const char* metadata)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3067 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3068 int64_t result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3069
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3070 _OrthancPluginAccessDicomInstance params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3071 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3072 params.resultInt64 = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3073 params.instance = instance;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3074 params.key = metadata;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3075
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3076 if (context->InvokeService(context, _OrthancPluginService_HasInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3077 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3078 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3079 return -1;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3080 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3081 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3082 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3083 return (result != 0);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3084 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3085 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3086
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3087
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3088 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3089 * @brief Get the value of some metadata associated with a given DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3090 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3091 * This functions returns the value of some metadata that is associated with the DICOM instance of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3092 * Before calling this function, the existence of the metadata must have been checked with
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3093 * ::OrthancPluginHasInstanceMetadata().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3094 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3095 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3096 * @param instance The instance of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3097 * @param metadata The metadata of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3098 * @return The metadata value if success, NULL if error. Please note that the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3099 * returned string belongs to the instance object and must NOT be
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3100 * deallocated. Please make a copy of the string if you wish to access
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3101 * it later.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3102 * @ingroup DicomInstance
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3103 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3104 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceMetadata(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3105 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3106 const OrthancPluginDicomInstance* instance,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3107 const char* metadata)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3108 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3109 const char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3110
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3111 _OrthancPluginAccessDicomInstance params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3112 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3113 params.resultString = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3114 params.instance = instance;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3115 params.key = metadata;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3116
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3117 if (context->InvokeService(context, _OrthancPluginService_GetInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3118 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3119 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3120 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3121 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3122 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3123 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3124 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3125 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3126 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3127
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3128
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3129
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3130 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3131 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3132 OrthancPluginStorageCreate create;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3133 OrthancPluginStorageRead read;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3134 OrthancPluginStorageRemove remove;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3135 OrthancPluginFree free;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3136 } _OrthancPluginRegisterStorageArea;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3137
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3138 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3139 * @brief Register a custom storage area.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3140 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3141 * This function registers a custom storage area, to replace the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3142 * built-in way Orthanc stores its files on the filesystem. This
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3143 * function must be called during the initialization of the plugin,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3144 * i.e. inside the OrthancPluginInitialize() public function.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3145 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3146 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3147 * @param create The callback function to store a file on the custom storage area.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3148 * @param read The callback function to read a file from the custom storage area.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3149 * @param remove The callback function to remove a file from the custom storage area.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3150 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3151 * @deprecated Please use OrthancPluginRegisterStorageArea2()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3152 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3153 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterStorageArea(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3154 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3155 OrthancPluginStorageCreate create,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3156 OrthancPluginStorageRead read,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3157 OrthancPluginStorageRemove remove)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3158 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3159 _OrthancPluginRegisterStorageArea params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3160 params.create = create;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3161 params.read = read;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3162 params.remove = remove;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3163
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3164 #ifdef __cplusplus
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3165 params.free = ::free;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3166 #else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3167 params.free = free;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3168 #endif
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3169
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3170 context->InvokeService(context, _OrthancPluginService_RegisterStorageArea, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3171 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3172
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3173
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3174
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3175 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3176 * @brief Return the path to the Orthanc executable.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3177 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3178 * This function returns the path to the Orthanc executable.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3179 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3180 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3181 * @return NULL in the case of an error, or a newly allocated string
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3182 * containing the path. This string must be freed by
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3183 * OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3184 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3185 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancPath(OrthancPluginContext* context)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3186 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3187 char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3188
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3189 _OrthancPluginRetrieveDynamicString params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3190 params.result = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3191 params.argument = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3192
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3193 if (context->InvokeService(context, _OrthancPluginService_GetOrthancPath, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3194 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3195 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3196 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3197 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3198 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3199 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3200 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3201 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3202 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3203
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3204
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3205 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3206 * @brief Return the directory containing the Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3207 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3208 * This function returns the path to the directory containing the Orthanc executable.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3209 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3210 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3211 * @return NULL in the case of an error, or a newly allocated string
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3212 * containing the path. This string must be freed by
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3213 * OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3214 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3215 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancDirectory(OrthancPluginContext* context)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3216 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3217 char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3218
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3219 _OrthancPluginRetrieveDynamicString params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3220 params.result = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3221 params.argument = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3222
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3223 if (context->InvokeService(context, _OrthancPluginService_GetOrthancDirectory, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3224 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3225 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3226 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3227 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3228 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3229 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3230 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3231 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3232 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3233
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3234
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3235 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3236 * @brief Return the path to the configuration file(s).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3237 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3238 * This function returns the path to the configuration file(s) that
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3239 * was specified when starting Orthanc. Since version 0.9.1, this
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3240 * path can refer to a folder that stores a set of configuration
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3241 * files. This function is deprecated in favor of
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3242 * OrthancPluginGetConfiguration().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3243 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3244 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3245 * @return NULL in the case of an error, or a newly allocated string
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3246 * containing the path. This string must be freed by
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3247 * OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3248 * @see OrthancPluginGetConfiguration()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3249 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3250 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfigurationPath(OrthancPluginContext* context)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3251 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3252 char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3253
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3254 _OrthancPluginRetrieveDynamicString params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3255 params.result = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3256 params.argument = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3257
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3258 if (context->InvokeService(context, _OrthancPluginService_GetConfigurationPath, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3259 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3260 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3261 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3262 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3263 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3264 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3265 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3266 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3267 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3268
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3269
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3270
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3271 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3272 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3273 OrthancPluginOnChangeCallback callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3274 } _OrthancPluginOnChangeCallback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3275
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3276 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3277 * @brief Register a callback to monitor changes.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3278 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3279 * This function registers a callback function that is called
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3280 * whenever a change happens to some DICOM resource.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3281 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3282 * @warning Your callback function will be called synchronously with
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3283 * the core of Orthanc. This implies that deadlocks might emerge if
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3284 * you call other core primitives of Orthanc in your callback (such
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3285 * deadlocks are particular visible in the presence of other plugins
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3286 * or Lua scripts). It is thus strongly advised to avoid any call to
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3287 * the REST API of Orthanc in the callback. If you have to call
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3288 * other primitives of Orthanc, you should make these calls in a
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3289 * separate thread, passing the pending events to be processed
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3290 * through a message queue.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3291 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3292 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3293 * @param callback The callback function.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3294 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3295 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3296 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnChangeCallback(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3297 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3298 OrthancPluginOnChangeCallback callback)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3299 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3300 _OrthancPluginOnChangeCallback params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3301 params.callback = callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3302
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3303 context->InvokeService(context, _OrthancPluginService_RegisterOnChangeCallback, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3304 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3305
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3306
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3307
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3308 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3309 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3310 const char* plugin;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3311 _OrthancPluginProperty property;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3312 const char* value;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3313 } _OrthancPluginSetPluginProperty;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3314
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3315
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3316 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3317 * @brief Set the URI where the plugin provides its Web interface.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3318 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3319 * For plugins that come with a Web interface, this function
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3320 * declares the entry path where to find this interface. This
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3321 * information is notably used in the "Plugins" page of Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3322 * Explorer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3323 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3324 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3325 * @param uri The root URI for this plugin.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3326 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3327 ORTHANC_PLUGIN_INLINE void OrthancPluginSetRootUri(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3328 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3329 const char* uri)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3330 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3331 _OrthancPluginSetPluginProperty params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3332 params.plugin = OrthancPluginGetName();
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3333 params.property = _OrthancPluginProperty_RootUri;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3334 params.value = uri;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3335
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3336 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3337 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3338
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3339
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3340 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3341 * @brief Set a description for this plugin.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3342 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3343 * Set a description for this plugin. It is displayed in the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3344 * "Plugins" page of Orthanc Explorer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3345 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3346 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3347 * @param description The description.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3348 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3349 ORTHANC_PLUGIN_INLINE void OrthancPluginSetDescription(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3350 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3351 const char* description)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3352 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3353 _OrthancPluginSetPluginProperty params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3354 params.plugin = OrthancPluginGetName();
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3355 params.property = _OrthancPluginProperty_Description;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3356 params.value = description;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3357
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3358 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3359 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3360
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3361
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3362 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3363 * @brief Extend the JavaScript code of Orthanc Explorer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3364 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3365 * Add JavaScript code to customize the default behavior of Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3366 * Explorer. This can for instance be used to add new buttons.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3367 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3368 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3369 * @param javascript The custom JavaScript code.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3370 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3371 ORTHANC_PLUGIN_INLINE void OrthancPluginExtendOrthancExplorer(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3372 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3373 const char* javascript)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3374 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3375 _OrthancPluginSetPluginProperty params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3376 params.plugin = OrthancPluginGetName();
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3377 params.property = _OrthancPluginProperty_OrthancExplorer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3378 params.value = javascript;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3379
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3380 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3381 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3382
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3383
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3384 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3385 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3386 char** result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3387 int32_t property;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3388 const char* value;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3389 } _OrthancPluginGlobalProperty;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3390
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3391
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3392 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3393 * @brief Get the value of a global property.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3394 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3395 * Get the value of a global property that is stored in the Orthanc database. Global
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3396 * properties whose index is below 1024 are reserved by Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3397 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3398 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3399 * @param property The global property of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3400 * @param defaultValue The value to return, if the global property is unset.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3401 * @return The value of the global property, or NULL in the case of an error. This
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3402 * string must be freed by OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3403 * @ingroup Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3404 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3405 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetGlobalProperty(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3406 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3407 int32_t property,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3408 const char* defaultValue)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3409 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3410 char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3411
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3412 _OrthancPluginGlobalProperty params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3413 params.result = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3414 params.property = property;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3415 params.value = defaultValue;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3416
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3417 if (context->InvokeService(context, _OrthancPluginService_GetGlobalProperty, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3418 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3419 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3420 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3421 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3422 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3423 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3424 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3425 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3426 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3427
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3428
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3429 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3430 * @brief Set the value of a global property.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3431 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3432 * Set the value of a global property into the Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3433 * database. Setting a global property can be used by plugins to
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3434 * save their internal parameters. Plugins are only allowed to set
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3435 * properties whose index are above or equal to 1024 (properties
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3436 * below 1024 are read-only and reserved by Orthanc).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3437 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3438 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3439 * @param property The global property of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3440 * @param value The value to be set in the global property.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3441 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3442 * @ingroup Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3443 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3444 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSetGlobalProperty(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3445 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3446 int32_t property,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3447 const char* value)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3448 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3449 _OrthancPluginGlobalProperty params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3450 params.result = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3451 params.property = property;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3452 params.value = value;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3453
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3454 return context->InvokeService(context, _OrthancPluginService_SetGlobalProperty, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3455 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3456
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3457
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3458
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3459 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3460 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3461 int32_t *resultInt32;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3462 uint32_t *resultUint32;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3463 int64_t *resultInt64;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3464 uint64_t *resultUint64;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3465 } _OrthancPluginReturnSingleValue;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3466
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3467 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3468 * @brief Get the number of command-line arguments.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3469 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3470 * Retrieve the number of command-line arguments that were used to launch Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3471 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3472 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3473 * @return The number of arguments.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3474 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3475 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetCommandLineArgumentsCount(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3476 OrthancPluginContext* context)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3477 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3478 uint32_t count = 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3479
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3480 _OrthancPluginReturnSingleValue params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3481 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3482 params.resultUint32 = &count;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3483
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3484 if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgumentsCount, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3485 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3486 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3487 return 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3488 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3489 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3490 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3491 return count;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3492 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3493 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3494
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3495
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3496
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3497 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3498 * @brief Get the value of a command-line argument.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3499 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3500 * Get the value of one of the command-line arguments that were used
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3501 * to launch Orthanc. The number of available arguments can be
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3502 * retrieved by OrthancPluginGetCommandLineArgumentsCount().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3503 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3504 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3505 * @param argument The index of the argument.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3506 * @return The value of the argument, or NULL in the case of an error. This
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3507 * string must be freed by OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3508 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3509 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetCommandLineArgument(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3510 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3511 uint32_t argument)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3512 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3513 char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3514
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3515 _OrthancPluginGlobalProperty params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3516 params.result = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3517 params.property = (int32_t) argument;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3518 params.value = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3519
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3520 if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgument, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3521 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3522 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3523 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3524 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3525 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3526 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3527 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3528 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3529 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3530
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3531
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3532 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3533 * @brief Get the expected version of the database schema.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3534 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3535 * Retrieve the expected version of the database schema.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3536 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3537 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3538 * @return The version.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3539 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3540 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3541 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetExpectedDatabaseVersion(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3542 OrthancPluginContext* context)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3543 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3544 uint32_t count = 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3545
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3546 _OrthancPluginReturnSingleValue params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3547 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3548 params.resultUint32 = &count;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3549
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3550 if (context->InvokeService(context, _OrthancPluginService_GetExpectedDatabaseVersion, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3551 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3552 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3553 return 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3554 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3555 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3556 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3557 return count;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3558 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3559 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3560
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3561
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3562
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3563 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3564 * @brief Return the content of the configuration file(s).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3565 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3566 * This function returns the content of the configuration that is
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3567 * used by Orthanc, formatted as a JSON string.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3568 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3569 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3570 * @return NULL in the case of an error, or a newly allocated string
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3571 * containing the configuration. This string must be freed by
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3572 * OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3573 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3574 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfiguration(OrthancPluginContext* context)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3575 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3576 char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3577
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3578 _OrthancPluginRetrieveDynamicString params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3579 params.result = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3580 params.argument = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3581
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3582 if (context->InvokeService(context, _OrthancPluginService_GetConfiguration, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3583 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3584 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3585 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3586 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3587 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3588 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3589 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3590 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3591 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3592
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3593
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3594
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3595 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3596 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3597 OrthancPluginRestOutput* output;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3598 const char* subType;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3599 const char* contentType;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3600 } _OrthancPluginStartMultipartAnswer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3601
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3602 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3603 * @brief Start an HTTP multipart answer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3604 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3605 * Initiates a HTTP multipart answer, as the result of a REST request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3606 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3607 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3608 * @param output The HTTP connection to the client application.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3609 * @param subType The sub-type of the multipart answer ("mixed" or "related").
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3610 * @param contentType The MIME type of the items in the multipart answer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3611 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3612 * @see OrthancPluginSendMultipartItem(), OrthancPluginSendMultipartItem2()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3613 * @ingroup REST
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3614 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3615 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStartMultipartAnswer(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3616 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3617 OrthancPluginRestOutput* output,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3618 const char* subType,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3619 const char* contentType)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3620 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3621 _OrthancPluginStartMultipartAnswer params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3622 params.output = output;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3623 params.subType = subType;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3624 params.contentType = contentType;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3625 return context->InvokeService(context, _OrthancPluginService_StartMultipartAnswer, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3626 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3627
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3628
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3629 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3630 * @brief Send an item as a part of some HTTP multipart answer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3631 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3632 * This function sends an item as a part of some HTTP multipart
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3633 * answer that was initiated by OrthancPluginStartMultipartAnswer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3634 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3635 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3636 * @param output The HTTP connection to the client application.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3637 * @param answer Pointer to the memory buffer containing the item.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3638 * @param answerSize Number of bytes of the item.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3639 * @return 0 if success, or the error code if failure (this notably happens
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3640 * if the connection is closed by the client).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3641 * @see OrthancPluginSendMultipartItem2()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3642 * @ingroup REST
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3643 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3644 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3645 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3646 OrthancPluginRestOutput* output,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3647 const void* answer,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3648 uint32_t answerSize)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3649 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3650 _OrthancPluginAnswerBuffer params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3651 params.output = output;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3652 params.answer = answer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3653 params.answerSize = answerSize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3654 params.mimeType = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3655 return context->InvokeService(context, _OrthancPluginService_SendMultipartItem, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3656 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3657
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3658
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3659
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3660 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3661 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3662 OrthancPluginMemoryBuffer* target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3663 const void* source;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3664 uint32_t size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3665 OrthancPluginCompressionType compression;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3666 uint8_t uncompress;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3667 } _OrthancPluginBufferCompression;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3668
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3669
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3670 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3671 * @brief Compress or decompress a buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3672 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3673 * This function compresses or decompresses a buffer, using the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3674 * version of the zlib library that is used by the Orthanc core.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3675 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3676 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3677 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3678 * @param source The source buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3679 * @param size The size in bytes of the source buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3680 * @param compression The compression algorithm.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3681 * @param uncompress If set to "0", the buffer must be compressed.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3682 * If set to "1", the buffer must be uncompressed.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3683 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3684 * @ingroup Images
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3685 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3686 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginBufferCompression(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3687 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3688 OrthancPluginMemoryBuffer* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3689 const void* source,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3690 uint32_t size,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3691 OrthancPluginCompressionType compression,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3692 uint8_t uncompress)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3693 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3694 _OrthancPluginBufferCompression params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3695 params.target = target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3696 params.source = source;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3697 params.size = size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3698 params.compression = compression;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3699 params.uncompress = uncompress;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3700
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3701 return context->InvokeService(context, _OrthancPluginService_BufferCompression, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3702 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3703
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3704
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3705
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3706 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3707 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3708 OrthancPluginMemoryBuffer* target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3709 const char* path;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3710 } _OrthancPluginReadFile;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3711
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3712 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3713 * @brief Read a file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3714 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3715 * Read the content of a file on the filesystem, and returns it into
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3716 * a newly allocated memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3717 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3718 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3719 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3720 * @param path The path of the file to be read.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3721 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3722 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3723 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReadFile(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3724 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3725 OrthancPluginMemoryBuffer* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3726 const char* path)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3727 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3728 _OrthancPluginReadFile params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3729 params.target = target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3730 params.path = path;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3731 return context->InvokeService(context, _OrthancPluginService_ReadFile, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3732 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3733
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3734
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3735
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3736 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3737 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3738 const char* path;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3739 const void* data;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3740 uint32_t size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3741 } _OrthancPluginWriteFile;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3742
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3743 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3744 * @brief Write a file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3745 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3746 * Write the content of a memory buffer to the filesystem.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3747 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3748 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3749 * @param path The path of the file to be written.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3750 * @param data The content of the memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3751 * @param size The size of the memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3752 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3753 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3754 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWriteFile(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3755 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3756 const char* path,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3757 const void* data,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3758 uint32_t size)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3759 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3760 _OrthancPluginWriteFile params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3761 params.path = path;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3762 params.data = data;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3763 params.size = size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3764 return context->InvokeService(context, _OrthancPluginService_WriteFile, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3765 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3766
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3767
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3768
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3769 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3770 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3771 const char** target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3772 OrthancPluginErrorCode error;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3773 } _OrthancPluginGetErrorDescription;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3774
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3775 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3776 * @brief Get the description of a given error code.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3777 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3778 * This function returns the description of a given error code.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3779 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3780 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3781 * @param error The error code of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3782 * @return The error description. This is a statically-allocated
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3783 * string, do not free it.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3784 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3785 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetErrorDescription(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3786 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3787 OrthancPluginErrorCode error)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3788 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3789 const char* result = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3790
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3791 _OrthancPluginGetErrorDescription params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3792 params.target = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3793 params.error = error;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3794
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3795 if (context->InvokeService(context, _OrthancPluginService_GetErrorDescription, &params) != OrthancPluginErrorCode_Success ||
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3796 result == NULL)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3797 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3798 return "Unknown error code";
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3799 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3800 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3801 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3802 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3803 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3804 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3805
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3806
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3807
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3808 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3809 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3810 OrthancPluginRestOutput* output;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3811 uint16_t status;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3812 const char* body;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3813 uint32_t bodySize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3814 } _OrthancPluginSendHttpStatus;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3815
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3816 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3817 * @brief Send a HTTP status, with a custom body.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3818 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3819 * This function answers to a HTTP request by sending a HTTP status
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3820 * code (such as "400 - Bad Request"), together with a body
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3821 * describing the error. The body will only be returned if the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3822 * configuration option "HttpDescribeErrors" of Orthanc is set to "true".
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3823 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3824 * Note that:
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3825 * - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3826 * - Redirections (status 301) must use ::OrthancPluginRedirect().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3827 * - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3828 * - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3829 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3830 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3831 * @param output The HTTP connection to the client application.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3832 * @param status The HTTP status code to be sent.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3833 * @param body The body of the answer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3834 * @param bodySize The size of the body.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3835 * @see OrthancPluginSendHttpStatusCode()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3836 * @ingroup REST
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3837 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3838 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatus(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3839 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3840 OrthancPluginRestOutput* output,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3841 uint16_t status,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3842 const char* body,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3843 uint32_t bodySize)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3844 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3845 _OrthancPluginSendHttpStatus params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3846 params.output = output;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3847 params.status = status;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3848 params.body = body;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3849 params.bodySize = bodySize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3850 context->InvokeService(context, _OrthancPluginService_SendHttpStatus, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3851 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3852
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3853
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3854
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3855 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3856 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3857 const OrthancPluginImage* image;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3858 uint32_t* resultUint32;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3859 OrthancPluginPixelFormat* resultPixelFormat;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3860 void** resultBuffer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3861 } _OrthancPluginGetImageInfo;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3862
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3863
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3864 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3865 * @brief Return the pixel format of an image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3866 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3867 * This function returns the type of memory layout for the pixels of the given image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3868 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3869 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3870 * @param image The image of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3871 * @return The pixel format.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3872 * @ingroup Images
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3873 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3874 ORTHANC_PLUGIN_INLINE OrthancPluginPixelFormat OrthancPluginGetImagePixelFormat(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3875 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3876 const OrthancPluginImage* image)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3877 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3878 OrthancPluginPixelFormat target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3879
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3880 _OrthancPluginGetImageInfo params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3881 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3882 params.image = image;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3883 params.resultPixelFormat = &target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3884
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3885 if (context->InvokeService(context, _OrthancPluginService_GetImagePixelFormat, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3886 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3887 return OrthancPluginPixelFormat_Unknown;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3888 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3889 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3890 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3891 return (OrthancPluginPixelFormat) target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3892 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3893 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3894
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3895
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3896
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3897 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3898 * @brief Return the width of an image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3899 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3900 * This function returns the width of the given image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3901 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3902 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3903 * @param image The image of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3904 * @return The width.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3905 * @ingroup Images
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3906 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3907 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageWidth(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3908 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3909 const OrthancPluginImage* image)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3910 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3911 uint32_t width;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3912
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3913 _OrthancPluginGetImageInfo params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3914 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3915 params.image = image;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3916 params.resultUint32 = &width;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3917
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3918 if (context->InvokeService(context, _OrthancPluginService_GetImageWidth, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3919 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3920 return 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3921 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3922 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3923 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3924 return width;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3925 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3926 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3927
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3928
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3929
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3930 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3931 * @brief Return the height of an image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3932 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3933 * This function returns the height of the given image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3934 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3935 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3936 * @param image The image of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3937 * @return The height.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3938 * @ingroup Images
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3939 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3940 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageHeight(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3941 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3942 const OrthancPluginImage* image)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3943 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3944 uint32_t height;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3945
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3946 _OrthancPluginGetImageInfo params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3947 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3948 params.image = image;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3949 params.resultUint32 = &height;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3950
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3951 if (context->InvokeService(context, _OrthancPluginService_GetImageHeight, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3952 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3953 return 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3954 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3955 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3956 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3957 return height;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3958 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3959 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3960
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3961
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3962
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3963 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3964 * @brief Return the pitch of an image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3965 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3966 * This function returns the pitch of the given image. The pitch is
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3967 * defined as the number of bytes between 2 successive lines of the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3968 * image in the memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3969 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3970 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3971 * @param image The image of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3972 * @return The pitch.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3973 * @ingroup Images
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3974 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3975 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImagePitch(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3976 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3977 const OrthancPluginImage* image)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3978 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3979 uint32_t pitch;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3980
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3981 _OrthancPluginGetImageInfo params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3982 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3983 params.image = image;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3984 params.resultUint32 = &pitch;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3985
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3986 if (context->InvokeService(context, _OrthancPluginService_GetImagePitch, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3987 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3988 return 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3989 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3990 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3991 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3992 return pitch;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3993 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3994 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3995
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3996
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3997
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3998 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3999 * @brief Return a pointer to the content of an image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4000 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4001 * This function returns a pointer to the memory buffer that
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4002 * contains the pixels of the image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4003 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4004 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4005 * @param image The image of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4006 * @return The pointer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4007 * @ingroup Images
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4008 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4009 ORTHANC_PLUGIN_INLINE void* OrthancPluginGetImageBuffer(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4010 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4011 const OrthancPluginImage* image)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4012 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4013 void* target = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4014
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4015 _OrthancPluginGetImageInfo params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4016 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4017 params.resultBuffer = &target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4018 params.image = image;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4019
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4020 if (context->InvokeService(context, _OrthancPluginService_GetImageBuffer, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4021 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4022 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4023 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4024 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4025 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4026 return target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4027 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4028 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4029
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4030
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4031 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4032 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4033 OrthancPluginImage** target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4034 const void* data;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4035 uint32_t size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4036 OrthancPluginImageFormat format;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4037 } _OrthancPluginUncompressImage;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4038
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4039
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4040 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4041 * @brief Decode a compressed image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4042 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4043 * This function decodes a compressed image from a memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4044 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4045 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4046 * @param data Pointer to a memory buffer containing the compressed image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4047 * @param size Size of the memory buffer containing the compressed image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4048 * @param format The file format of the compressed image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4049 * @return The uncompressed image. It must be freed with OrthancPluginFreeImage().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4050 * @ingroup Images
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4051 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4052 ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginUncompressImage(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4053 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4054 const void* data,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4055 uint32_t size,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4056 OrthancPluginImageFormat format)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4057 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4058 OrthancPluginImage* target = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4059
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4060 _OrthancPluginUncompressImage params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4061 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4062 params.target = &target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4063 params.data = data;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4064 params.size = size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4065 params.format = format;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4066
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4067 if (context->InvokeService(context, _OrthancPluginService_UncompressImage, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4068 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4069 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4070 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4071 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4072 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4073 return target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4074 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4075 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4076
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4077
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4078
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4079
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4080 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4081 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4082 OrthancPluginImage* image;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4083 } _OrthancPluginFreeImage;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4084
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4085 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4086 * @brief Free an image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4087 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4088 * This function frees an image that was decoded with OrthancPluginUncompressImage().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4089 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4090 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4091 * @param image The image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4092 * @ingroup Images
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4093 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4094 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeImage(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4095 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4096 OrthancPluginImage* image)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4097 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4098 _OrthancPluginFreeImage params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4099 params.image = image;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4100
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4101 context->InvokeService(context, _OrthancPluginService_FreeImage, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4102 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4103
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4104
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4105
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4106
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4107 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4108 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4109 OrthancPluginMemoryBuffer* target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4110 OrthancPluginImageFormat imageFormat;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4111 OrthancPluginPixelFormat pixelFormat;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4112 uint32_t width;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4113 uint32_t height;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4114 uint32_t pitch;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4115 const void* buffer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4116 uint8_t quality;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4117 } _OrthancPluginCompressImage;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4118
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4119
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4120 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4121 * @brief Encode a PNG image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4122 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4123 * This function compresses the given memory buffer containing an
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4124 * image using the PNG specification, and stores the result of the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4125 * compression into a newly allocated memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4126 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4127 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4128 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4129 * @param format The memory layout of the uncompressed image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4130 * @param width The width of the image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4131 * @param height The height of the image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4132 * @param pitch The pitch of the image (i.e. the number of bytes
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4133 * between 2 successive lines of the image in the memory buffer).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4134 * @param buffer The memory buffer containing the uncompressed image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4135 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4136 * @see OrthancPluginCompressAndAnswerPngImage()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4137 * @ingroup Images
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4138 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4139 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressPngImage(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4140 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4141 OrthancPluginMemoryBuffer* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4142 OrthancPluginPixelFormat format,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4143 uint32_t width,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4144 uint32_t height,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4145 uint32_t pitch,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4146 const void* buffer)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4147 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4148 _OrthancPluginCompressImage params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4149 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4150 params.target = target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4151 params.imageFormat = OrthancPluginImageFormat_Png;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4152 params.pixelFormat = format;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4153 params.width = width;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4154 params.height = height;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4155 params.pitch = pitch;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4156 params.buffer = buffer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4157 params.quality = 0; /* Unused for PNG */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4158
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4159 return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4160 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4161
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4162
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4163 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4164 * @brief Encode a JPEG image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4165 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4166 * This function compresses the given memory buffer containing an
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4167 * image using the JPEG specification, and stores the result of the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4168 * compression into a newly allocated memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4169 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4170 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4171 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4172 * @param format The memory layout of the uncompressed image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4173 * @param width The width of the image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4174 * @param height The height of the image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4175 * @param pitch The pitch of the image (i.e. the number of bytes
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4176 * between 2 successive lines of the image in the memory buffer).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4177 * @param buffer The memory buffer containing the uncompressed image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4178 * @param quality The quality of the JPEG encoding, between 1 (worst
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4179 * quality, best compression) and 100 (best quality, worst
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4180 * compression).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4181 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4182 * @ingroup Images
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4183 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4184 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressJpegImage(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4185 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4186 OrthancPluginMemoryBuffer* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4187 OrthancPluginPixelFormat format,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4188 uint32_t width,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4189 uint32_t height,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4190 uint32_t pitch,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4191 const void* buffer,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4192 uint8_t quality)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4193 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4194 _OrthancPluginCompressImage params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4195 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4196 params.target = target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4197 params.imageFormat = OrthancPluginImageFormat_Jpeg;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4198 params.pixelFormat = format;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4199 params.width = width;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4200 params.height = height;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4201 params.pitch = pitch;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4202 params.buffer = buffer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4203 params.quality = quality;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4204
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4205 return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4206 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4207
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4208
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4209
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4210 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4211 * @brief Answer to a REST request with a JPEG image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4212 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4213 * This function answers to a REST request with a JPEG image. The
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4214 * parameters of this function describe a memory buffer that
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4215 * contains an uncompressed image. The image will be automatically compressed
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4216 * as a JPEG image by the core system of Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4217 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4218 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4219 * @param output The HTTP connection to the client application.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4220 * @param format The memory layout of the uncompressed image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4221 * @param width The width of the image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4222 * @param height The height of the image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4223 * @param pitch The pitch of the image (i.e. the number of bytes
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4224 * between 2 successive lines of the image in the memory buffer).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4225 * @param buffer The memory buffer containing the uncompressed image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4226 * @param quality The quality of the JPEG encoding, between 1 (worst
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4227 * quality, best compression) and 100 (best quality, worst
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4228 * compression).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4229 * @ingroup REST
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4230 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4231 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerJpegImage(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4232 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4233 OrthancPluginRestOutput* output,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4234 OrthancPluginPixelFormat format,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4235 uint32_t width,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4236 uint32_t height,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4237 uint32_t pitch,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4238 const void* buffer,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4239 uint8_t quality)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4240 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4241 _OrthancPluginCompressAndAnswerImage params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4242 params.output = output;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4243 params.imageFormat = OrthancPluginImageFormat_Jpeg;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4244 params.pixelFormat = format;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4245 params.width = width;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4246 params.height = height;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4247 params.pitch = pitch;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4248 params.buffer = buffer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4249 params.quality = quality;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4250 context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4251 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4252
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4253
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4254
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4255
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4256 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4257 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4258 OrthancPluginMemoryBuffer* target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4259 OrthancPluginHttpMethod method;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4260 const char* url;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4261 const char* username;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4262 const char* password;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4263 const void* body;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4264 uint32_t bodySize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4265 } _OrthancPluginCallHttpClient;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4266
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4267
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4268 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4269 * @brief Issue a HTTP GET call.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4270 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4271 * Make a HTTP GET call to the given URL. The result to the query is
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4272 * stored into a newly allocated memory buffer. Favor
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4273 * OrthancPluginRestApiGet() if calling the built-in REST API of the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4274 * Orthanc instance that hosts this plugin.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4275 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4276 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4277 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4278 * @param url The URL of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4279 * @param username The username (can be <tt>NULL</tt> if no password protection).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4280 * @param password The password (can be <tt>NULL</tt> if no password protection).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4281 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4282 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4283 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4284 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpGet(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4285 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4286 OrthancPluginMemoryBuffer* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4287 const char* url,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4288 const char* username,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4289 const char* password)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4290 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4291 _OrthancPluginCallHttpClient params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4292 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4293
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4294 params.target = target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4295 params.method = OrthancPluginHttpMethod_Get;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4296 params.url = url;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4297 params.username = username;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4298 params.password = password;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4299
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4300 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4301 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4302
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4303
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4304 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4305 * @brief Issue a HTTP POST call.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4306 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4307 * Make a HTTP POST call to the given URL. The result to the query
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4308 * is stored into a newly allocated memory buffer. Favor
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4309 * OrthancPluginRestApiPost() if calling the built-in REST API of
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4310 * the Orthanc instance that hosts this plugin.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4311 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4312 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4313 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4314 * @param url The URL of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4315 * @param body The content of the body of the request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4316 * @param bodySize The size of the body of the request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4317 * @param username The username (can be <tt>NULL</tt> if no password protection).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4318 * @param password The password (can be <tt>NULL</tt> if no password protection).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4319 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4320 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4321 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4322 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPost(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4323 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4324 OrthancPluginMemoryBuffer* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4325 const char* url,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4326 const void* body,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4327 uint32_t bodySize,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4328 const char* username,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4329 const char* password)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4330 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4331 _OrthancPluginCallHttpClient params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4332 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4333
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4334 params.target = target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4335 params.method = OrthancPluginHttpMethod_Post;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4336 params.url = url;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4337 params.body = body;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4338 params.bodySize = bodySize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4339 params.username = username;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4340 params.password = password;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4341
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4342 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4343 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4344
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4345
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4346 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4347 * @brief Issue a HTTP PUT call.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4348 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4349 * Make a HTTP PUT call to the given URL. The result to the query is
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4350 * stored into a newly allocated memory buffer. Favor
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4351 * OrthancPluginRestApiPut() if calling the built-in REST API of the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4352 * Orthanc instance that hosts this plugin.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4353 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4354 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4355 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4356 * @param url The URL of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4357 * @param body The content of the body of the request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4358 * @param bodySize The size of the body of the request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4359 * @param username The username (can be <tt>NULL</tt> if no password protection).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4360 * @param password The password (can be <tt>NULL</tt> if no password protection).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4361 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4362 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4363 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4364 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPut(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4365 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4366 OrthancPluginMemoryBuffer* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4367 const char* url,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4368 const void* body,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4369 uint32_t bodySize,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4370 const char* username,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4371 const char* password)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4372 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4373 _OrthancPluginCallHttpClient params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4374 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4375
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4376 params.target = target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4377 params.method = OrthancPluginHttpMethod_Put;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4378 params.url = url;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4379 params.body = body;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4380 params.bodySize = bodySize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4381 params.username = username;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4382 params.password = password;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4383
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4384 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4385 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4386
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4387
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4388 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4389 * @brief Issue a HTTP DELETE call.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4390 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4391 * Make a HTTP DELETE call to the given URL. Favor
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4392 * OrthancPluginRestApiDelete() if calling the built-in REST API of
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4393 * the Orthanc instance that hosts this plugin.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4394 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4395 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4396 * @param url The URL of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4397 * @param username The username (can be <tt>NULL</tt> if no password protection).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4398 * @param password The password (can be <tt>NULL</tt> if no password protection).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4399 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4400 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4401 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4402 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpDelete(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4403 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4404 const char* url,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4405 const char* username,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4406 const char* password)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4407 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4408 _OrthancPluginCallHttpClient params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4409 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4410
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4411 params.method = OrthancPluginHttpMethod_Delete;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4412 params.url = url;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4413 params.username = username;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4414 params.password = password;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4415
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4416 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4417 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4418
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4419
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4420
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4421 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4422 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4423 OrthancPluginImage** target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4424 const OrthancPluginImage* source;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4425 OrthancPluginPixelFormat targetFormat;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4426 } _OrthancPluginConvertPixelFormat;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4427
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4428
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4429 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4430 * @brief Change the pixel format of an image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4431 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4432 * This function creates a new image, changing the memory layout of the pixels.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4433 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4434 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4435 * @param source The source image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4436 * @param targetFormat The target pixel format.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4437 * @return The resulting image. It must be freed with OrthancPluginFreeImage().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4438 * @ingroup Images
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4439 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4440 ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginConvertPixelFormat(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4441 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4442 const OrthancPluginImage* source,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4443 OrthancPluginPixelFormat targetFormat)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4444 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4445 OrthancPluginImage* target = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4446
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4447 _OrthancPluginConvertPixelFormat params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4448 params.target = &target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4449 params.source = source;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4450 params.targetFormat = targetFormat;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4451
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4452 if (context->InvokeService(context, _OrthancPluginService_ConvertPixelFormat, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4453 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4454 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4455 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4456 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4457 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4458 return target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4459 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4460 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4461
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4462
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4463
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4464 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4465 * @brief Return the number of available fonts.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4466 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4467 * This function returns the number of fonts that are built in the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4468 * Orthanc core. These fonts can be used to draw texts on images
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4469 * through OrthancPluginDrawText().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4470 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4471 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4472 * @return The number of fonts.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4473 * @ingroup Images
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4474 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4475 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontsCount(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4476 OrthancPluginContext* context)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4477 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4478 uint32_t count = 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4479
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4480 _OrthancPluginReturnSingleValue params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4481 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4482 params.resultUint32 = &count;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4483
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4484 if (context->InvokeService(context, _OrthancPluginService_GetFontsCount, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4485 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4486 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4487 return 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4488 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4489 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4490 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4491 return count;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4492 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4493 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4494
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4495
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4496
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4497
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4498 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4499 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4500 uint32_t fontIndex; /* in */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4501 const char** name; /* out */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4502 uint32_t* size; /* out */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4503 } _OrthancPluginGetFontInfo;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4504
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4505 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4506 * @brief Return the name of a font.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4507 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4508 * This function returns the name of a font that is built in the Orthanc core.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4509 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4510 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4511 * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4512 * @return The font name. This is a statically-allocated string, do not free it.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4513 * @ingroup Images
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4514 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4515 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetFontName(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4516 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4517 uint32_t fontIndex)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4518 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4519 const char* result = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4520
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4521 _OrthancPluginGetFontInfo params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4522 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4523 params.name = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4524 params.fontIndex = fontIndex;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4525
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4526 if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4527 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4528 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4529 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4530 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4531 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4532 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4533 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4534 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4535
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4536
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4537 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4538 * @brief Return the size of a font.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4539 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4540 * This function returns the size of a font that is built in the Orthanc core.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4541 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4542 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4543 * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4544 * @return The font size.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4545 * @ingroup Images
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4546 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4547 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontSize(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4548 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4549 uint32_t fontIndex)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4550 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4551 uint32_t result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4552
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4553 _OrthancPluginGetFontInfo params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4554 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4555 params.size = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4556 params.fontIndex = fontIndex;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4557
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4558 if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4559 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4560 return 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4561 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4562 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4563 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4564 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4565 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4566 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4567
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4568
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4569
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4570 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4571 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4572 OrthancPluginImage* image;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4573 uint32_t fontIndex;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4574 const char* utf8Text;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4575 int32_t x;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4576 int32_t y;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4577 uint8_t r;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4578 uint8_t g;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4579 uint8_t b;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4580 } _OrthancPluginDrawText;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4581
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4582
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4583 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4584 * @brief Draw text on an image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4585 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4586 * This function draws some text on some image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4587 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4588 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4589 * @param image The image upon which to draw the text.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4590 * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4591 * @param utf8Text The text to be drawn, encoded as an UTF-8 zero-terminated string.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4592 * @param x The X position of the text over the image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4593 * @param y The Y position of the text over the image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4594 * @param r The value of the red color channel of the text.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4595 * @param g The value of the green color channel of the text.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4596 * @param b The value of the blue color channel of the text.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4597 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4598 * @ingroup Images
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4599 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4600 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginDrawText(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4601 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4602 OrthancPluginImage* image,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4603 uint32_t fontIndex,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4604 const char* utf8Text,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4605 int32_t x,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4606 int32_t y,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4607 uint8_t r,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4608 uint8_t g,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4609 uint8_t b)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4610 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4611 _OrthancPluginDrawText params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4612 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4613 params.image = image;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4614 params.fontIndex = fontIndex;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4615 params.utf8Text = utf8Text;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4616 params.x = x;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4617 params.y = y;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4618 params.r = r;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4619 params.g = g;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4620 params.b = b;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4621
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4622 return context->InvokeService(context, _OrthancPluginService_DrawText, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4623 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4624
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4625
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4626
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4627 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4628 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4629 OrthancPluginStorageArea* storageArea;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4630 const char* uuid;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4631 const void* content;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4632 uint64_t size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4633 OrthancPluginContentType type;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4634 } _OrthancPluginStorageAreaCreate;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4635
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4636
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4637 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4638 * @brief Create a file inside the storage area.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4639 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4640 * This function creates a new file inside the storage area that is
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4641 * currently used by Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4642 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4643 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4644 * @param storageArea The storage area.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4645 * @param uuid The identifier of the file to be created.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4646 * @param content The content to store in the newly created file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4647 * @param size The size of the content.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4648 * @param type The type of the file content.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4649 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4650 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4651 * @deprecated This function should not be used anymore. Use "OrthancPluginRestApiPut()" on
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4652 * "/{patients|studies|series|instances}/{id}/attachments/{name}" instead.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4653 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4654 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaCreate(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4655 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4656 OrthancPluginStorageArea* storageArea,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4657 const char* uuid,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4658 const void* content,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4659 uint64_t size,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4660 OrthancPluginContentType type)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4661 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4662 _OrthancPluginStorageAreaCreate params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4663 params.storageArea = storageArea;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4664 params.uuid = uuid;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4665 params.content = content;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4666 params.size = size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4667 params.type = type;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4668
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4669 return context->InvokeService(context, _OrthancPluginService_StorageAreaCreate, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4670 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4671
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4672
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4673 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4674 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4675 OrthancPluginMemoryBuffer* target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4676 OrthancPluginStorageArea* storageArea;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4677 const char* uuid;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4678 OrthancPluginContentType type;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4679 } _OrthancPluginStorageAreaRead;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4680
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4681
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4682 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4683 * @brief Read a file from the storage area.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4684 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4685 * This function reads the content of a given file from the storage
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4686 * area that is currently used by Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4687 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4688 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4689 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4690 * @param storageArea The storage area.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4691 * @param uuid The identifier of the file to be read.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4692 * @param type The type of the file content.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4693 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4694 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4695 * @deprecated This function should not be used anymore. Use "OrthancPluginRestApiGet()" on
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4696 * "/{patients|studies|series|instances}/{id}/attachments/{name}" instead.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4697 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4698 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRead(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4699 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4700 OrthancPluginMemoryBuffer* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4701 OrthancPluginStorageArea* storageArea,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4702 const char* uuid,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4703 OrthancPluginContentType type)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4704 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4705 _OrthancPluginStorageAreaRead params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4706 params.target = target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4707 params.storageArea = storageArea;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4708 params.uuid = uuid;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4709 params.type = type;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4710
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4711 return context->InvokeService(context, _OrthancPluginService_StorageAreaRead, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4712 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4713
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4714
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4715 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4716 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4717 OrthancPluginStorageArea* storageArea;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4718 const char* uuid;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4719 OrthancPluginContentType type;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4720 } _OrthancPluginStorageAreaRemove;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4721
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4722 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4723 * @brief Remove a file from the storage area.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4724 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4725 * This function removes a given file from the storage area that is
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4726 * currently used by Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4727 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4728 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4729 * @param storageArea The storage area.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4730 * @param uuid The identifier of the file to be removed.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4731 * @param type The type of the file content.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4732 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4733 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4734 * @deprecated This function should not be used anymore. Use "OrthancPluginRestApiDelete()" on
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4735 * "/{patients|studies|series|instances}/{id}/attachments/{name}" instead.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4736 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4737 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRemove(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4738 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4739 OrthancPluginStorageArea* storageArea,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4740 const char* uuid,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4741 OrthancPluginContentType type)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4742 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4743 _OrthancPluginStorageAreaRemove params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4744 params.storageArea = storageArea;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4745 params.uuid = uuid;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4746 params.type = type;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4747
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4748 return context->InvokeService(context, _OrthancPluginService_StorageAreaRemove, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4749 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4750
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4751
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4752
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4753 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4754 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4755 OrthancPluginErrorCode* target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4756 int32_t code;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4757 uint16_t httpStatus;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4758 const char* message;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4759 } _OrthancPluginRegisterErrorCode;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4760
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4761 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4762 * @brief Declare a custom error code for this plugin.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4763 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4764 * This function declares a custom error code that can be generated
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4765 * by this plugin. This declaration is used to enrich the body of
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4766 * the HTTP answer in the case of an error, and to set the proper
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4767 * HTTP status code.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4768 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4769 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4770 * @param code The error code that is internal to this plugin.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4771 * @param httpStatus The HTTP status corresponding to this error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4772 * @param message The description of the error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4773 * @return The error code that has been assigned inside the Orthanc core.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4774 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4775 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4776 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterErrorCode(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4777 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4778 int32_t code,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4779 uint16_t httpStatus,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4780 const char* message)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4781 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4782 OrthancPluginErrorCode target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4783
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4784 _OrthancPluginRegisterErrorCode params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4785 params.target = &target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4786 params.code = code;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4787 params.httpStatus = httpStatus;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4788 params.message = message;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4789
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4790 if (context->InvokeService(context, _OrthancPluginService_RegisterErrorCode, &params) == OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4791 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4792 return target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4793 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4794 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4795 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4796 /* There was an error while assigned the error. Use a generic code. */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4797 return OrthancPluginErrorCode_Plugin;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4798 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4799 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4800
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4801
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4802
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4803 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4804 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4805 uint16_t group;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4806 uint16_t element;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4807 OrthancPluginValueRepresentation vr;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4808 const char* name;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4809 uint32_t minMultiplicity;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4810 uint32_t maxMultiplicity;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4811 } _OrthancPluginRegisterDictionaryTag;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4812
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4813 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4814 * @brief Register a new tag into the DICOM dictionary.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4815 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4816 * This function declares a new public tag in the dictionary of
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4817 * DICOM tags that are known to Orthanc. This function should be
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4818 * used in the OrthancPluginInitialize() callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4819 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4820 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4821 * @param group The group of the tag.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4822 * @param element The element of the tag.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4823 * @param vr The value representation of the tag.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4824 * @param name The nickname of the tag.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4825 * @param minMultiplicity The minimum multiplicity of the tag (must be above 0).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4826 * @param maxMultiplicity The maximum multiplicity of the tag. A value of 0 means
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4827 * an arbitrary multiplicity ("<tt>n</tt>").
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4828 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4829 * @see OrthancPluginRegisterPrivateDictionaryTag()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4830 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4831 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4832 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDictionaryTag(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4833 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4834 uint16_t group,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4835 uint16_t element,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4836 OrthancPluginValueRepresentation vr,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4837 const char* name,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4838 uint32_t minMultiplicity,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4839 uint32_t maxMultiplicity)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4840 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4841 _OrthancPluginRegisterDictionaryTag params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4842 params.group = group;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4843 params.element = element;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4844 params.vr = vr;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4845 params.name = name;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4846 params.minMultiplicity = minMultiplicity;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4847 params.maxMultiplicity = maxMultiplicity;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4848
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4849 return context->InvokeService(context, _OrthancPluginService_RegisterDictionaryTag, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4850 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4851
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4852
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4853
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4854 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4855 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4856 uint16_t group;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4857 uint16_t element;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4858 OrthancPluginValueRepresentation vr;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4859 const char* name;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4860 uint32_t minMultiplicity;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4861 uint32_t maxMultiplicity;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4862 const char* privateCreator;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4863 } _OrthancPluginRegisterPrivateDictionaryTag;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4864
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4865 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4866 * @brief Register a new private tag into the DICOM dictionary.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4867 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4868 * This function declares a new private tag in the dictionary of
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4869 * DICOM tags that are known to Orthanc. This function should be
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4870 * used in the OrthancPluginInitialize() callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4871 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4872 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4873 * @param group The group of the tag.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4874 * @param element The element of the tag.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4875 * @param vr The value representation of the tag.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4876 * @param name The nickname of the tag.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4877 * @param minMultiplicity The minimum multiplicity of the tag (must be above 0).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4878 * @param maxMultiplicity The maximum multiplicity of the tag. A value of 0 means
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4879 * an arbitrary multiplicity ("<tt>n</tt>").
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4880 * @param privateCreator The private creator of this private tag.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4881 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4882 * @see OrthancPluginRegisterDictionaryTag()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4883 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4884 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4885 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterPrivateDictionaryTag(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4886 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4887 uint16_t group,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4888 uint16_t element,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4889 OrthancPluginValueRepresentation vr,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4890 const char* name,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4891 uint32_t minMultiplicity,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4892 uint32_t maxMultiplicity,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4893 const char* privateCreator)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4894 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4895 _OrthancPluginRegisterPrivateDictionaryTag params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4896 params.group = group;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4897 params.element = element;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4898 params.vr = vr;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4899 params.name = name;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4900 params.minMultiplicity = minMultiplicity;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4901 params.maxMultiplicity = maxMultiplicity;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4902 params.privateCreator = privateCreator;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4903
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4904 return context->InvokeService(context, _OrthancPluginService_RegisterPrivateDictionaryTag, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4905 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4906
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4907
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4908
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4909 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4910 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4911 OrthancPluginStorageArea* storageArea;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4912 OrthancPluginResourceType level;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4913 } _OrthancPluginReconstructMainDicomTags;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4914
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4915 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4916 * @brief Reconstruct the main DICOM tags.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4917 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4918 * This function requests the Orthanc core to reconstruct the main
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4919 * DICOM tags of all the resources of the given type. This function
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4920 * can only be used as a part of the upgrade of a custom database
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4921 * back-end. A database transaction will be automatically setup.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4922 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4923 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4924 * @param storageArea The storage area.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4925 * @param level The type of the resources of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4926 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4927 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4928 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4929 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReconstructMainDicomTags(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4930 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4931 OrthancPluginStorageArea* storageArea,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4932 OrthancPluginResourceType level)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4933 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4934 _OrthancPluginReconstructMainDicomTags params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4935 params.level = level;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4936 params.storageArea = storageArea;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4937
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4938 return context->InvokeService(context, _OrthancPluginService_ReconstructMainDicomTags, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4939 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4940
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4941
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4942 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4943 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4944 char** result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4945 const char* instanceId;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4946 const void* buffer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4947 uint32_t size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4948 OrthancPluginDicomToJsonFormat format;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4949 OrthancPluginDicomToJsonFlags flags;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4950 uint32_t maxStringLength;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4951 } _OrthancPluginDicomToJson;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4952
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4953
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4954 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4955 * @brief Format a DICOM memory buffer as a JSON string.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4956 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4957 * This function takes as input a memory buffer containing a DICOM
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4958 * file, and outputs a JSON string representing the tags of this
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4959 * DICOM file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4960 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4961 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4962 * @param buffer The memory buffer containing the DICOM file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4963 * @param size The size of the memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4964 * @param format The output format.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4965 * @param flags Flags governing the output.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4966 * @param maxStringLength The maximum length of a field. Too long fields will
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4967 * be output as "null". The 0 value means no maximum length.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4968 * @return The NULL value if the case of an error, or the JSON
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4969 * string. This string must be freed by OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4970 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4971 * @see OrthancPluginDicomInstanceToJson
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4972 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4973 ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomBufferToJson(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4974 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4975 const void* buffer,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4976 uint32_t size,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4977 OrthancPluginDicomToJsonFormat format,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4978 OrthancPluginDicomToJsonFlags flags,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4979 uint32_t maxStringLength)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4980 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4981 char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4982
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4983 _OrthancPluginDicomToJson params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4984 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4985 params.result = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4986 params.buffer = buffer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4987 params.size = size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4988 params.format = format;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4989 params.flags = flags;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4990 params.maxStringLength = maxStringLength;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4991
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4992 if (context->InvokeService(context, _OrthancPluginService_DicomBufferToJson, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4993 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4994 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4995 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4996 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4997 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4998 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4999 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5000 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5001 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5002
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5003
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5004 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5005 * @brief Format a DICOM instance as a JSON string.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5006 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5007 * This function formats a DICOM instance that is stored in Orthanc,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5008 * and outputs a JSON string representing the tags of this DICOM
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5009 * instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5010 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5011 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5012 * @param instanceId The Orthanc identifier of the instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5013 * @param format The output format.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5014 * @param flags Flags governing the output.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5015 * @param maxStringLength The maximum length of a field. Too long fields will
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5016 * be output as "null". The 0 value means no maximum length.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5017 * @return The NULL value if the case of an error, or the JSON
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5018 * string. This string must be freed by OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5019 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5020 * @see OrthancPluginDicomInstanceToJson
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5021 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5022 ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomInstanceToJson(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5023 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5024 const char* instanceId,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5025 OrthancPluginDicomToJsonFormat format,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5026 OrthancPluginDicomToJsonFlags flags,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5027 uint32_t maxStringLength)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5028 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5029 char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5030
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5031 _OrthancPluginDicomToJson params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5032 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5033 params.result = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5034 params.instanceId = instanceId;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5035 params.format = format;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5036 params.flags = flags;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5037 params.maxStringLength = maxStringLength;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5038
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5039 if (context->InvokeService(context, _OrthancPluginService_DicomInstanceToJson, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5040 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5041 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5042 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5043 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5044 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5045 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5046 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5047 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5048 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5049
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5050
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5051 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5052 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5053 OrthancPluginMemoryBuffer* target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5054 const char* uri;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5055 uint32_t headersCount;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5056 const char* const* headersKeys;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5057 const char* const* headersValues;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5058 int32_t afterPlugins;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5059 } _OrthancPluginRestApiGet2;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5060
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5061 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5062 * @brief Make a GET call to the Orthanc REST API, with custom HTTP headers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5063 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5064 * Make a GET call to the Orthanc REST API with extended
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5065 * parameters. The result to the query is stored into a newly
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5066 * allocated memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5067 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5068 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5069 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5070 * @param uri The URI in the built-in Orthanc API.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5071 * @param headersCount The number of HTTP headers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5072 * @param headersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5073 * @param headersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5074 * @param afterPlugins If 0, the built-in API of Orthanc is used.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5075 * If 1, the API is tainted by the plugins.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5076 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5077 * @see OrthancPluginRestApiGet, OrthancPluginRestApiGetAfterPlugins
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5078 * @ingroup Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5079 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5080 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet2(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5081 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5082 OrthancPluginMemoryBuffer* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5083 const char* uri,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5084 uint32_t headersCount,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5085 const char* const* headersKeys,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5086 const char* const* headersValues,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5087 int32_t afterPlugins)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5088 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5089 _OrthancPluginRestApiGet2 params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5090 params.target = target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5091 params.uri = uri;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5092 params.headersCount = headersCount;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5093 params.headersKeys = headersKeys;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5094 params.headersValues = headersValues;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5095 params.afterPlugins = afterPlugins;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5096
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5097 return context->InvokeService(context, _OrthancPluginService_RestApiGet2, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5098 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5099
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5100
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5101
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5102 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5103 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5104 OrthancPluginWorklistCallback callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5105 } _OrthancPluginWorklistCallback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5106
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5107 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5108 * @brief Register a callback to handle modality worklists requests.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5109 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5110 * This function registers a callback to handle C-Find SCP requests
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5111 * on modality worklists.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5112 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5113 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5114 * @param callback The callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5115 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5116 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5117 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5118 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterWorklistCallback(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5119 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5120 OrthancPluginWorklistCallback callback)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5121 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5122 _OrthancPluginWorklistCallback params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5123 params.callback = callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5124
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5125 return context->InvokeService(context, _OrthancPluginService_RegisterWorklistCallback, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5126 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5127
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5128
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5129
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5130 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5131 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5132 OrthancPluginWorklistAnswers* answers;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5133 const OrthancPluginWorklistQuery* query;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5134 const void* dicom;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5135 uint32_t size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5136 } _OrthancPluginWorklistAnswersOperation;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5137
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5138 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5139 * @brief Add one answer to some modality worklist request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5140 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5141 * This function adds one worklist (encoded as a DICOM file) to the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5142 * set of answers corresponding to some C-Find SCP request against
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5143 * modality worklists.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5144 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5145 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5146 * @param answers The set of answers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5147 * @param query The worklist query, as received by the callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5148 * @param dicom The worklist to answer, encoded as a DICOM file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5149 * @param size The size of the DICOM file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5150 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5151 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5152 * @see OrthancPluginCreateDicom()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5153 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5154 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistAddAnswer(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5155 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5156 OrthancPluginWorklistAnswers* answers,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5157 const OrthancPluginWorklistQuery* query,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5158 const void* dicom,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5159 uint32_t size)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5160 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5161 _OrthancPluginWorklistAnswersOperation params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5162 params.answers = answers;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5163 params.query = query;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5164 params.dicom = dicom;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5165 params.size = size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5166
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5167 return context->InvokeService(context, _OrthancPluginService_WorklistAddAnswer, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5168 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5169
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5170
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5171 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5172 * @brief Mark the set of worklist answers as incomplete.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5173 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5174 * This function marks as incomplete the set of answers
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5175 * corresponding to some C-Find SCP request against modality
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5176 * worklists. This must be used if canceling the handling of a
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5177 * request when too many answers are to be returned.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5178 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5179 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5180 * @param answers The set of answers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5181 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5182 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5183 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5184 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistMarkIncomplete(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5185 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5186 OrthancPluginWorklistAnswers* answers)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5187 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5188 _OrthancPluginWorklistAnswersOperation params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5189 params.answers = answers;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5190 params.query = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5191 params.dicom = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5192 params.size = 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5193
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5194 return context->InvokeService(context, _OrthancPluginService_WorklistMarkIncomplete, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5195 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5196
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5197
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5198 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5199 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5200 const OrthancPluginWorklistQuery* query;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5201 const void* dicom;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5202 uint32_t size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5203 int32_t* isMatch;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5204 OrthancPluginMemoryBuffer* target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5205 } _OrthancPluginWorklistQueryOperation;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5206
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5207 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5208 * @brief Test whether a worklist matches the query.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5209 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5210 * This function checks whether one worklist (encoded as a DICOM
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5211 * file) matches the C-Find SCP query against modality
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5212 * worklists. This function must be called before adding the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5213 * worklist as an answer through OrthancPluginWorklistAddAnswer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5214 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5215 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5216 * @param query The worklist query, as received by the callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5217 * @param dicom The worklist to answer, encoded as a DICOM file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5218 * @param size The size of the DICOM file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5219 * @return 1 if the worklist matches the query, 0 otherwise.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5220 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5221 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5222 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginWorklistIsMatch(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5223 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5224 const OrthancPluginWorklistQuery* query,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5225 const void* dicom,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5226 uint32_t size)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5227 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5228 int32_t isMatch = 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5229
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5230 _OrthancPluginWorklistQueryOperation params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5231 params.query = query;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5232 params.dicom = dicom;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5233 params.size = size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5234 params.isMatch = &isMatch;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5235 params.target = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5236
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5237 if (context->InvokeService(context, _OrthancPluginService_WorklistIsMatch, &params) == OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5238 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5239 return isMatch;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5240 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5241 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5242 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5243 /* Error: Assume non-match */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5244 return 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5245 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5246 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5247
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5248
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5249 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5250 * @brief Retrieve the worklist query as a DICOM file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5251 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5252 * This function retrieves the DICOM file that underlies a C-Find
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5253 * SCP query against modality worklists.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5254 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5255 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5256 * @param target Memory buffer where to store the DICOM file. It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5257 * @param query The worklist query, as received by the callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5258 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5259 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5260 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5261 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistGetDicomQuery(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5262 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5263 OrthancPluginMemoryBuffer* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5264 const OrthancPluginWorklistQuery* query)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5265 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5266 _OrthancPluginWorklistQueryOperation params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5267 params.query = query;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5268 params.dicom = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5269 params.size = 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5270 params.isMatch = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5271 params.target = target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5272
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5273 return context->InvokeService(context, _OrthancPluginService_WorklistGetDicomQuery, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5274 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5275
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5276
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5277 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5278 * @brief Get the origin of a DICOM file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5279 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5280 * This function returns the origin of a DICOM instance that has been received by Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5281 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5282 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5283 * @param instance The instance of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5284 * @return The origin of the instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5285 * @ingroup DicomInstance
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5286 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5287 ORTHANC_PLUGIN_INLINE OrthancPluginInstanceOrigin OrthancPluginGetInstanceOrigin(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5288 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5289 const OrthancPluginDicomInstance* instance)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5290 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5291 OrthancPluginInstanceOrigin origin;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5292
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5293 _OrthancPluginAccessDicomInstance params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5294 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5295 params.resultOrigin = &origin;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5296 params.instance = instance;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5297
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5298 if (context->InvokeService(context, _OrthancPluginService_GetInstanceOrigin, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5299 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5300 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5301 return OrthancPluginInstanceOrigin_Unknown;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5302 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5303 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5304 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5305 return origin;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5306 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5307 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5308
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5309
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5310 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5311 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5312 OrthancPluginMemoryBuffer* target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5313 const char* json;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5314 const OrthancPluginImage* pixelData;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5315 OrthancPluginCreateDicomFlags flags;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5316 } _OrthancPluginCreateDicom;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5317
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5318 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5319 * @brief Create a DICOM instance from a JSON string and an image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5320 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5321 * This function takes as input a string containing a JSON file
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5322 * describing the content of a DICOM instance. As an output, it
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5323 * writes the corresponding DICOM instance to a newly allocated
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5324 * memory buffer. Additionally, an image to be encoded within the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5325 * DICOM instance can also be provided.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5326 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5327 * Private tags will be associated with the private creator whose
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5328 * value is specified in the "DefaultPrivateCreator" configuration
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5329 * option of Orthanc. The function OrthancPluginCreateDicom2() can
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5330 * be used if another private creator must be used to create this
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5331 * instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5332 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5333 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5334 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5335 * @param json The input JSON file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5336 * @param pixelData The image. Can be NULL, if the pixel data is encoded inside the JSON with the data URI scheme.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5337 * @param flags Flags governing the output.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5338 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5339 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5340 * @see OrthancPluginCreateDicom2
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5341 * @see OrthancPluginDicomBufferToJson
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5342 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5343 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCreateDicom(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5344 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5345 OrthancPluginMemoryBuffer* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5346 const char* json,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5347 const OrthancPluginImage* pixelData,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5348 OrthancPluginCreateDicomFlags flags)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5349 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5350 _OrthancPluginCreateDicom params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5351 params.target = target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5352 params.json = json;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5353 params.pixelData = pixelData;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5354 params.flags = flags;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5355
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5356 return context->InvokeService(context, _OrthancPluginService_CreateDicom, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5357 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5358
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5359
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5360 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5361 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5362 OrthancPluginDecodeImageCallback callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5363 } _OrthancPluginDecodeImageCallback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5364
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5365 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5366 * @brief Register a callback to handle the decoding of DICOM images.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5367 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5368 * This function registers a custom callback to decode DICOM images,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5369 * extending the built-in decoder of Orthanc that uses
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5370 * DCMTK. Starting with Orthanc 1.7.0, the exact behavior is
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5371 * affected by the configuration option
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5372 * "BuiltinDecoderTranscoderOrder" of Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5373 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5374 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5375 * @param callback The callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5376 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5377 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5378 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5379 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDecodeImageCallback(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5380 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5381 OrthancPluginDecodeImageCallback callback)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5382 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5383 _OrthancPluginDecodeImageCallback params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5384 params.callback = callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5385
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5386 return context->InvokeService(context, _OrthancPluginService_RegisterDecodeImageCallback, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5387 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5388
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5389
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5390
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5391 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5392 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5393 OrthancPluginImage** target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5394 OrthancPluginPixelFormat format;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5395 uint32_t width;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5396 uint32_t height;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5397 uint32_t pitch;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5398 void* buffer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5399 const void* constBuffer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5400 uint32_t bufferSize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5401 uint32_t frameIndex;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5402 } _OrthancPluginCreateImage;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5403
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5404
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5405 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5406 * @brief Create an image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5407 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5408 * This function creates an image of given size and format.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5409 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5410 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5411 * @param format The format of the pixels.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5412 * @param width The width of the image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5413 * @param height The height of the image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5414 * @return The newly allocated image. It must be freed with OrthancPluginFreeImage().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5415 * @ingroup Images
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5416 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5417 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginCreateImage(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5418 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5419 OrthancPluginPixelFormat format,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5420 uint32_t width,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5421 uint32_t height)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5422 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5423 OrthancPluginImage* target = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5424
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5425 _OrthancPluginCreateImage params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5426 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5427 params.target = &target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5428 params.format = format;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5429 params.width = width;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5430 params.height = height;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5431
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5432 if (context->InvokeService(context, _OrthancPluginService_CreateImage, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5433 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5434 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5435 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5436 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5437 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5438 return target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5439 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5440 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5441
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5442
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5443 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5444 * @brief Create an image pointing to a memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5445 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5446 * This function creates an image whose content points to a memory
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5447 * buffer managed by the plugin. Note that the buffer is directly
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5448 * accessed, no memory is allocated and no data is copied.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5449 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5450 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5451 * @param format The format of the pixels.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5452 * @param width The width of the image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5453 * @param height The height of the image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5454 * @param pitch The pitch of the image (i.e. the number of bytes
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5455 * between 2 successive lines of the image in the memory buffer).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5456 * @param buffer The memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5457 * @return The newly allocated image. It must be freed with OrthancPluginFreeImage().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5458 * @ingroup Images
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5459 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5460 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginCreateImageAccessor(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5461 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5462 OrthancPluginPixelFormat format,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5463 uint32_t width,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5464 uint32_t height,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5465 uint32_t pitch,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5466 void* buffer)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5467 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5468 OrthancPluginImage* target = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5469
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5470 _OrthancPluginCreateImage params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5471 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5472 params.target = &target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5473 params.format = format;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5474 params.width = width;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5475 params.height = height;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5476 params.pitch = pitch;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5477 params.buffer = buffer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5478
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5479 if (context->InvokeService(context, _OrthancPluginService_CreateImageAccessor, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5480 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5481 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5482 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5483 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5484 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5485 return target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5486 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5487 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5488
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5489
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5490
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5491 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5492 * @brief Decode one frame from a DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5493 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5494 * This function decodes one frame of a DICOM image that is stored
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5495 * in a memory buffer. This function will give the same result as
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5496 * OrthancPluginUncompressImage() for single-frame DICOM images.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5497 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5498 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5499 * @param buffer Pointer to a memory buffer containing the DICOM image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5500 * @param bufferSize Size of the memory buffer containing the DICOM image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5501 * @param frameIndex The index of the frame of interest in a multi-frame image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5502 * @return The uncompressed image. It must be freed with OrthancPluginFreeImage().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5503 * @ingroup Images
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5504 * @see OrthancPluginGetInstanceDecodedFrame()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5505 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5506 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginDecodeDicomImage(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5507 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5508 const void* buffer,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5509 uint32_t bufferSize,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5510 uint32_t frameIndex)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5511 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5512 OrthancPluginImage* target = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5513
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5514 _OrthancPluginCreateImage params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5515 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5516 params.target = &target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5517 params.constBuffer = buffer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5518 params.bufferSize = bufferSize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5519 params.frameIndex = frameIndex;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5520
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5521 if (context->InvokeService(context, _OrthancPluginService_DecodeDicomImage, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5522 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5523 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5524 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5525 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5526 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5527 return target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5528 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5529 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5530
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5531
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5532
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5533 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5534 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5535 char** result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5536 const void* buffer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5537 uint32_t size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5538 } _OrthancPluginComputeHash;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5539
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5540 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5541 * @brief Compute an MD5 hash.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5542 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5543 * This functions computes the MD5 cryptographic hash of the given memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5544 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5545 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5546 * @param buffer The source memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5547 * @param size The size in bytes of the source buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5548 * @return The NULL value in case of error, or a string containing the cryptographic hash.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5549 * This string must be freed by OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5550 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5551 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5552 ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeMd5(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5553 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5554 const void* buffer,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5555 uint32_t size)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5556 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5557 char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5558
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5559 _OrthancPluginComputeHash params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5560 params.result = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5561 params.buffer = buffer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5562 params.size = size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5563
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5564 if (context->InvokeService(context, _OrthancPluginService_ComputeMd5, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5565 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5566 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5567 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5568 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5569 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5570 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5571 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5572 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5573 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5574
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5575
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5576 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5577 * @brief Compute a SHA-1 hash.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5578 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5579 * This functions computes the SHA-1 cryptographic hash of the given memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5580 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5581 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5582 * @param buffer The source memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5583 * @param size The size in bytes of the source buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5584 * @return The NULL value in case of error, or a string containing the cryptographic hash.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5585 * This string must be freed by OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5586 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5587 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5588 ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeSha1(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5589 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5590 const void* buffer,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5591 uint32_t size)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5592 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5593 char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5594
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5595 _OrthancPluginComputeHash params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5596 params.result = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5597 params.buffer = buffer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5598 params.size = size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5599
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5600 if (context->InvokeService(context, _OrthancPluginService_ComputeSha1, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5601 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5602 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5603 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5604 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5605 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5606 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5607 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5608 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5609 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5610
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5611
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5612
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5613 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5614 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5615 OrthancPluginDictionaryEntry* target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5616 const char* name;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5617 } _OrthancPluginLookupDictionary;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5618
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5619 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5620 * @brief Get information about the given DICOM tag.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5621 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5622 * This functions makes a lookup in the dictionary of DICOM tags
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5623 * that are known to Orthanc, and returns information about this
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5624 * tag. The tag can be specified using its human-readable name
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5625 * (e.g. "PatientName") or a set of two hexadecimal numbers
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5626 * (e.g. "0010-0020").
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5627 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5628 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5629 * @param target Where to store the information about the tag.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5630 * @param name The name of the DICOM tag.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5631 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5632 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5633 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5634 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginLookupDictionary(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5635 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5636 OrthancPluginDictionaryEntry* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5637 const char* name)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5638 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5639 _OrthancPluginLookupDictionary params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5640 params.target = target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5641 params.name = name;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5642 return context->InvokeService(context, _OrthancPluginService_LookupDictionary, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5643 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5644
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5645
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5646
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5647 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5648 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5649 OrthancPluginRestOutput* output;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5650 const void* answer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5651 uint32_t answerSize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5652 uint32_t headersCount;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5653 const char* const* headersKeys;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5654 const char* const* headersValues;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5655 } _OrthancPluginSendMultipartItem2;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5656
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5657 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5658 * @brief Send an item as a part of some HTTP multipart answer, with custom headers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5659 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5660 * This function sends an item as a part of some HTTP multipart
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5661 * answer that was initiated by OrthancPluginStartMultipartAnswer(). In addition to
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5662 * OrthancPluginSendMultipartItem(), this function will set HTTP header associated
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5663 * with the item.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5664 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5665 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5666 * @param output The HTTP connection to the client application.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5667 * @param answer Pointer to the memory buffer containing the item.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5668 * @param answerSize Number of bytes of the item.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5669 * @param headersCount The number of HTTP headers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5670 * @param headersKeys Array containing the keys of the HTTP headers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5671 * @param headersValues Array containing the values of the HTTP headers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5672 * @return 0 if success, or the error code if failure (this notably happens
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5673 * if the connection is closed by the client).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5674 * @see OrthancPluginSendMultipartItem()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5675 * @ingroup REST
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5676 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5677 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem2(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5678 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5679 OrthancPluginRestOutput* output,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5680 const void* answer,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5681 uint32_t answerSize,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5682 uint32_t headersCount,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5683 const char* const* headersKeys,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5684 const char* const* headersValues)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5685 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5686 _OrthancPluginSendMultipartItem2 params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5687 params.output = output;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5688 params.answer = answer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5689 params.answerSize = answerSize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5690 params.headersCount = headersCount;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5691 params.headersKeys = headersKeys;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5692 params.headersValues = headersValues;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5693
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5694 return context->InvokeService(context, _OrthancPluginService_SendMultipartItem2, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5695 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5696
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5697
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5698 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5699 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5700 OrthancPluginIncomingHttpRequestFilter callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5701 } _OrthancPluginIncomingHttpRequestFilter;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5702
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5703 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5704 * @brief Register a callback to filter incoming HTTP requests.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5705 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5706 * This function registers a custom callback to filter incoming HTTP/REST
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5707 * requests received by the HTTP server of Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5708 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5709 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5710 * @param callback The callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5711 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5712 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5713 * @deprecated Please instead use OrthancPluginRegisterIncomingHttpRequestFilter2()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5714 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5715 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5716 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5717 OrthancPluginIncomingHttpRequestFilter callback)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5718 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5719 _OrthancPluginIncomingHttpRequestFilter params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5720 params.callback = callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5721
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5722 return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5723 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5724
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5725
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5726
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5727 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5728 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5729 OrthancPluginMemoryBuffer* answerBody;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5730 OrthancPluginMemoryBuffer* answerHeaders;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5731 uint16_t* httpStatus;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5732 OrthancPluginHttpMethod method;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5733 const char* url;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5734 uint32_t headersCount;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5735 const char* const* headersKeys;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5736 const char* const* headersValues;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5737 const void* body;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5738 uint32_t bodySize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5739 const char* username;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5740 const char* password;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5741 uint32_t timeout;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5742 const char* certificateFile;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5743 const char* certificateKeyFile;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5744 const char* certificateKeyPassword;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5745 uint8_t pkcs11;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5746 } _OrthancPluginCallHttpClient2;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5747
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5748
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5749
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5750 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5751 * @brief Issue a HTTP call with full flexibility.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5752 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5753 * Make a HTTP call to the given URL. The result to the query is
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5754 * stored into a newly allocated memory buffer. The HTTP request
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5755 * will be done accordingly to the global configuration of Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5756 * (in particular, the options "HttpProxy", "HttpTimeout",
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5757 * "HttpsVerifyPeers", "HttpsCACertificates", and "Pkcs11" will be
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5758 * taken into account).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5759 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5760 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5761 * @param answerBody The target memory buffer (out argument).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5762 * It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5763 * The value of this argument is ignored if the HTTP method is DELETE.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5764 * @param answerHeaders The target memory buffer for the HTTP headers in the answers (out argument).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5765 * The answer headers are formatted as a JSON object (associative array).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5766 * The buffer must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5767 * This argument can be set to NULL if the plugin has no interest in the HTTP headers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5768 * @param httpStatus The HTTP status after the execution of the request (out argument).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5769 * @param method HTTP method to be used.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5770 * @param url The URL of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5771 * @param headersCount The number of HTTP headers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5772 * @param headersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5773 * @param headersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5774 * @param username The username (can be <tt>NULL</tt> if no password protection).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5775 * @param password The password (can be <tt>NULL</tt> if no password protection).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5776 * @param body The HTTP body for a POST or PUT request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5777 * @param bodySize The size of the body.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5778 * @param timeout Timeout in seconds (0 for default timeout).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5779 * @param certificateFile Path to the client certificate for HTTPS, in PEM format
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5780 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5781 * @param certificateKeyFile Path to the key of the client certificate for HTTPS, in PEM format
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5782 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5783 * @param certificateKeyPassword Password to unlock the key of the client certificate
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5784 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5785 * @param pkcs11 Enable PKCS#11 client authentication for hardware security modules and smart cards.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5786 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5787 * @see OrthancPluginCallPeerApi()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5788 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5789 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5790 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpClient(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5791 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5792 OrthancPluginMemoryBuffer* answerBody,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5793 OrthancPluginMemoryBuffer* answerHeaders,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5794 uint16_t* httpStatus,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5795 OrthancPluginHttpMethod method,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5796 const char* url,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5797 uint32_t headersCount,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5798 const char* const* headersKeys,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5799 const char* const* headersValues,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5800 const void* body,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5801 uint32_t bodySize,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5802 const char* username,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5803 const char* password,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5804 uint32_t timeout,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5805 const char* certificateFile,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5806 const char* certificateKeyFile,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5807 const char* certificateKeyPassword,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5808 uint8_t pkcs11)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5809 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5810 _OrthancPluginCallHttpClient2 params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5811 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5812
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5813 params.answerBody = answerBody;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5814 params.answerHeaders = answerHeaders;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5815 params.httpStatus = httpStatus;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5816 params.method = method;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5817 params.url = url;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5818 params.headersCount = headersCount;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5819 params.headersKeys = headersKeys;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5820 params.headersValues = headersValues;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5821 params.body = body;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5822 params.bodySize = bodySize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5823 params.username = username;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5824 params.password = password;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5825 params.timeout = timeout;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5826 params.certificateFile = certificateFile;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5827 params.certificateKeyFile = certificateKeyFile;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5828 params.certificateKeyPassword = certificateKeyPassword;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5829 params.pkcs11 = pkcs11;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5830
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5831 return context->InvokeService(context, _OrthancPluginService_CallHttpClient2, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5832 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5833
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5834
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5835 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5836 * @brief Generate an UUID.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5837 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5838 * Generate a random GUID/UUID (globally unique identifier).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5839 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5840 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5841 * @return NULL in the case of an error, or a newly allocated string
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5842 * containing the UUID. This string must be freed by OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5843 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5844 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5845 ORTHANC_PLUGIN_INLINE char* OrthancPluginGenerateUuid(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5846 OrthancPluginContext* context)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5847 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5848 char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5849
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5850 _OrthancPluginRetrieveDynamicString params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5851 params.result = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5852 params.argument = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5853
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5854 if (context->InvokeService(context, _OrthancPluginService_GenerateUuid, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5855 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5856 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5857 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5858 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5859 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5860 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5861 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5862 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5863 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5864
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5865
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5866
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5867
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5868 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5869 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5870 OrthancPluginFindCallback callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5871 } _OrthancPluginFindCallback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5872
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5873 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5874 * @brief Register a callback to handle C-Find requests.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5875 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5876 * This function registers a callback to handle C-Find SCP requests
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5877 * that are not related to modality worklists.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5878 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5879 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5880 * @param callback The callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5881 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5882 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5883 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5884 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterFindCallback(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5885 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5886 OrthancPluginFindCallback callback)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5887 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5888 _OrthancPluginFindCallback params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5889 params.callback = callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5890
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5891 return context->InvokeService(context, _OrthancPluginService_RegisterFindCallback, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5892 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5893
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5894
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5895 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5896 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5897 OrthancPluginFindAnswers *answers;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5898 const OrthancPluginFindQuery *query;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5899 const void *dicom;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5900 uint32_t size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5901 uint32_t index;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5902 uint32_t *resultUint32;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5903 uint16_t *resultGroup;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5904 uint16_t *resultElement;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5905 char **resultString;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5906 } _OrthancPluginFindOperation;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5907
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5908 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5909 * @brief Add one answer to some C-Find request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5910 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5911 * This function adds one answer (encoded as a DICOM file) to the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5912 * set of answers corresponding to some C-Find SCP request that is
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5913 * not related to modality worklists.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5914 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5915 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5916 * @param answers The set of answers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5917 * @param dicom The answer to be added, encoded as a DICOM file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5918 * @param size The size of the DICOM file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5919 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5920 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5921 * @see OrthancPluginCreateDicom()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5922 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5923 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginFindAddAnswer(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5924 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5925 OrthancPluginFindAnswers* answers,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5926 const void* dicom,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5927 uint32_t size)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5928 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5929 _OrthancPluginFindOperation params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5930 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5931 params.answers = answers;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5932 params.dicom = dicom;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5933 params.size = size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5934
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5935 return context->InvokeService(context, _OrthancPluginService_FindAddAnswer, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5936 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5937
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5938
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5939 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5940 * @brief Mark the set of C-Find answers as incomplete.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5941 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5942 * This function marks as incomplete the set of answers
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5943 * corresponding to some C-Find SCP request that is not related to
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5944 * modality worklists. This must be used if canceling the handling
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5945 * of a request when too many answers are to be returned.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5946 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5947 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5948 * @param answers The set of answers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5949 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5950 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5951 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5952 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginFindMarkIncomplete(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5953 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5954 OrthancPluginFindAnswers* answers)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5955 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5956 _OrthancPluginFindOperation params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5957 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5958 params.answers = answers;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5959
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5960 return context->InvokeService(context, _OrthancPluginService_FindMarkIncomplete, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5961 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5962
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5963
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5964
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5965 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5966 * @brief Get the number of tags in a C-Find query.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5967 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5968 * This function returns the number of tags that are contained in
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5969 * the given C-Find query.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5970 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5971 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5972 * @param query The C-Find query.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5973 * @return The number of tags.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5974 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5975 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5976 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFindQuerySize(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5977 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5978 const OrthancPluginFindQuery* query)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5979 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5980 uint32_t count = 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5981
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5982 _OrthancPluginFindOperation params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5983 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5984 params.query = query;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5985 params.resultUint32 = &count;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5986
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5987 if (context->InvokeService(context, _OrthancPluginService_GetFindQuerySize, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5988 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5989 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5990 return 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5991 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5992 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5993 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5994 return count;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5995 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5996 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5997
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5998
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5999 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6000 * @brief Get one tag in a C-Find query.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6001 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6002 * This function returns the group and the element of one DICOM tag
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6003 * in the given C-Find query.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6004 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6005 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6006 * @param group The group of the tag (output).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6007 * @param element The element of the tag (output).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6008 * @param query The C-Find query.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6009 * @param index The index of the tag of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6010 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6011 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6012 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6013 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetFindQueryTag(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6014 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6015 uint16_t* group,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6016 uint16_t* element,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6017 const OrthancPluginFindQuery* query,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6018 uint32_t index)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6019 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6020 _OrthancPluginFindOperation params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6021 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6022 params.query = query;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6023 params.index = index;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6024 params.resultGroup = group;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6025 params.resultElement = element;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6026
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6027 return context->InvokeService(context, _OrthancPluginService_GetFindQueryTag, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6028 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6029
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6030
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6031 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6032 * @brief Get the symbolic name of one tag in a C-Find query.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6033 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6034 * This function returns the symbolic name of one DICOM tag in the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6035 * given C-Find query.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6036 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6037 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6038 * @param query The C-Find query.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6039 * @param index The index of the tag of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6040 * @return The NULL value in case of error, or a string containing the name of the tag.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6041 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6042 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6043 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6044 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryTagName(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6045 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6046 const OrthancPluginFindQuery* query,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6047 uint32_t index)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6048 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6049 char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6050
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6051 _OrthancPluginFindOperation params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6052 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6053 params.query = query;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6054 params.index = index;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6055 params.resultString = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6056
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6057 if (context->InvokeService(context, _OrthancPluginService_GetFindQueryTagName, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6058 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6059 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6060 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6061 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6062 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6063 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6064 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6065 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6066 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6067
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6068
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6069 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6070 * @brief Get the value associated with one tag in a C-Find query.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6071 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6072 * This function returns the value associated with one tag in the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6073 * given C-Find query.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6074 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6075 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6076 * @param query The C-Find query.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6077 * @param index The index of the tag of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6078 * @return The NULL value in case of error, or a string containing the value of the tag.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6079 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6080 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6081 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6082 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryValue(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6083 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6084 const OrthancPluginFindQuery* query,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6085 uint32_t index)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6086 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6087 char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6088
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6089 _OrthancPluginFindOperation params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6090 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6091 params.query = query;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6092 params.index = index;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6093 params.resultString = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6094
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6095 if (context->InvokeService(context, _OrthancPluginService_GetFindQueryValue, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6096 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6097 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6098 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6099 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6100 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6101 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6102 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6103 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6104 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6105
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6106
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6107
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6108
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6109 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6110 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6111 OrthancPluginMoveCallback callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6112 OrthancPluginGetMoveSize getMoveSize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6113 OrthancPluginApplyMove applyMove;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6114 OrthancPluginFreeMove freeMove;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6115 } _OrthancPluginMoveCallback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6116
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6117 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6118 * @brief Register a callback to handle C-Move requests.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6119 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6120 * This function registers a callback to handle C-Move SCP requests.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6121 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6122 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6123 * @param callback The main callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6124 * @param getMoveSize Callback to read the number of C-Move suboperations.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6125 * @param applyMove Callback to apply one C-Move suboperation.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6126 * @param freeMove Callback to free the C-Move driver.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6127 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6128 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6129 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6130 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterMoveCallback(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6131 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6132 OrthancPluginMoveCallback callback,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6133 OrthancPluginGetMoveSize getMoveSize,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6134 OrthancPluginApplyMove applyMove,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6135 OrthancPluginFreeMove freeMove)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6136 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6137 _OrthancPluginMoveCallback params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6138 params.callback = callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6139 params.getMoveSize = getMoveSize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6140 params.applyMove = applyMove;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6141 params.freeMove = freeMove;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6142
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6143 return context->InvokeService(context, _OrthancPluginService_RegisterMoveCallback, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6144 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6145
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6146
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6147
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6148 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6149 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6150 OrthancPluginFindMatcher** target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6151 const void* query;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6152 uint32_t size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6153 } _OrthancPluginCreateFindMatcher;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6154
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6155
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6156 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6157 * @brief Create a C-Find matcher.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6158 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6159 * This function creates a "matcher" object that can be used to
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6160 * check whether a DICOM instance matches a C-Find query. The C-Find
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6161 * query must be expressed as a DICOM buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6162 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6163 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6164 * @param query The C-Find DICOM query.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6165 * @param size The size of the DICOM query.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6166 * @return The newly allocated matcher. It must be freed with OrthancPluginFreeFindMatcher().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6167 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6168 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6169 ORTHANC_PLUGIN_INLINE OrthancPluginFindMatcher* OrthancPluginCreateFindMatcher(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6170 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6171 const void* query,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6172 uint32_t size)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6173 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6174 OrthancPluginFindMatcher* target = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6175
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6176 _OrthancPluginCreateFindMatcher params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6177 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6178 params.target = &target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6179 params.query = query;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6180 params.size = size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6181
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6182 if (context->InvokeService(context, _OrthancPluginService_CreateFindMatcher, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6183 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6184 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6185 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6186 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6187 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6188 return target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6189 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6190 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6191
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6192
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6193 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6194 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6195 OrthancPluginFindMatcher* matcher;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6196 } _OrthancPluginFreeFindMatcher;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6197
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6198 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6199 * @brief Free a C-Find matcher.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6200 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6201 * This function frees a matcher that was created using OrthancPluginCreateFindMatcher().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6202 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6203 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6204 * @param matcher The matcher of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6205 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6206 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6207 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeFindMatcher(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6208 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6209 OrthancPluginFindMatcher* matcher)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6210 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6211 _OrthancPluginFreeFindMatcher params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6212 params.matcher = matcher;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6213
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6214 context->InvokeService(context, _OrthancPluginService_FreeFindMatcher, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6215 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6216
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6217
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6218 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6219 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6220 const OrthancPluginFindMatcher* matcher;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6221 const void* dicom;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6222 uint32_t size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6223 int32_t* isMatch;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6224 } _OrthancPluginFindMatcherIsMatch;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6225
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6226 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6227 * @brief Test whether a DICOM instance matches a C-Find query.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6228 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6229 * This function checks whether one DICOM instance matches C-Find
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6230 * matcher that was previously allocated using
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6231 * OrthancPluginCreateFindMatcher().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6232 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6233 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6234 * @param matcher The matcher of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6235 * @param dicom The DICOM instance to be matched.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6236 * @param size The size of the DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6237 * @return 1 if the DICOM instance matches the query, 0 otherwise.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6238 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6239 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6240 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginFindMatcherIsMatch(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6241 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6242 const OrthancPluginFindMatcher* matcher,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6243 const void* dicom,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6244 uint32_t size)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6245 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6246 int32_t isMatch = 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6247
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6248 _OrthancPluginFindMatcherIsMatch params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6249 params.matcher = matcher;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6250 params.dicom = dicom;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6251 params.size = size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6252 params.isMatch = &isMatch;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6253
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6254 if (context->InvokeService(context, _OrthancPluginService_FindMatcherIsMatch, &params) == OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6255 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6256 return isMatch;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6257 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6258 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6259 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6260 /* Error: Assume non-match */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6261 return 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6262 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6263 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6264
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6265
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6266 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6267 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6268 OrthancPluginIncomingHttpRequestFilter2 callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6269 } _OrthancPluginIncomingHttpRequestFilter2;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6270
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6271 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6272 * @brief Register a callback to filter incoming HTTP requests.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6273 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6274 * This function registers a custom callback to filter incoming HTTP/REST
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6275 * requests received by the HTTP server of Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6276 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6277 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6278 * @param callback The callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6279 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6280 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6281 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6282 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter2(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6283 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6284 OrthancPluginIncomingHttpRequestFilter2 callback)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6285 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6286 _OrthancPluginIncomingHttpRequestFilter2 params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6287 params.callback = callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6288
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6289 return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter2, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6290 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6291
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6292
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6293
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6294 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6295 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6296 OrthancPluginPeers** peers;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6297 } _OrthancPluginGetPeers;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6298
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6299 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6300 * @brief Return the list of available Orthanc peers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6301 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6302 * This function returns the parameters of the Orthanc peers that are known to
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6303 * the Orthanc server hosting the plugin.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6304 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6305 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6306 * @return NULL if error, or a newly allocated opaque data structure containing the peers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6307 * This structure must be freed with OrthancPluginFreePeers().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6308 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6309 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6310 ORTHANC_PLUGIN_INLINE OrthancPluginPeers* OrthancPluginGetPeers(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6311 OrthancPluginContext* context)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6312 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6313 OrthancPluginPeers* peers = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6314
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6315 _OrthancPluginGetPeers params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6316 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6317 params.peers = &peers;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6318
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6319 if (context->InvokeService(context, _OrthancPluginService_GetPeers, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6320 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6321 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6322 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6323 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6324 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6325 return peers;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6326 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6327 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6328
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6329
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6330 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6331 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6332 OrthancPluginPeers* peers;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6333 } _OrthancPluginFreePeers;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6334
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6335 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6336 * @brief Free the list of available Orthanc peers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6337 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6338 * This function frees the data structure returned by OrthancPluginGetPeers().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6339 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6340 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6341 * @param peers The data structure describing the Orthanc peers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6342 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6343 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6344 ORTHANC_PLUGIN_INLINE void OrthancPluginFreePeers(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6345 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6346 OrthancPluginPeers* peers)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6347 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6348 _OrthancPluginFreePeers params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6349 params.peers = peers;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6350
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6351 context->InvokeService(context, _OrthancPluginService_FreePeers, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6352 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6353
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6354
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6355 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6356 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6357 uint32_t* target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6358 const OrthancPluginPeers* peers;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6359 } _OrthancPluginGetPeersCount;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6360
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6361 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6362 * @brief Get the number of Orthanc peers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6363 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6364 * This function returns the number of Orthanc peers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6365 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6366 * This function is thread-safe: Several threads sharing the same
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6367 * OrthancPluginPeers object can simultaneously call this function.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6368 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6369 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6370 * @param peers The data structure describing the Orthanc peers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6371 * @result The number of peers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6372 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6373 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6374 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetPeersCount(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6375 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6376 const OrthancPluginPeers* peers)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6377 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6378 uint32_t target = 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6379
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6380 _OrthancPluginGetPeersCount params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6381 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6382 params.target = &target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6383 params.peers = peers;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6384
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6385 if (context->InvokeService(context, _OrthancPluginService_GetPeersCount, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6386 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6387 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6388 return 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6389 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6390 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6391 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6392 return target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6393 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6394 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6395
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6396
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6397 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6398 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6399 const char** target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6400 const OrthancPluginPeers* peers;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6401 uint32_t peerIndex;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6402 const char* userProperty;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6403 } _OrthancPluginGetPeerProperty;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6404
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6405 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6406 * @brief Get the symbolic name of an Orthanc peer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6407 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6408 * This function returns the symbolic name of the Orthanc peer,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6409 * which corresponds to the key of the "OrthancPeers" configuration
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6410 * option of Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6411 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6412 * This function is thread-safe: Several threads sharing the same
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6413 * OrthancPluginPeers object can simultaneously call this function.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6414 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6415 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6416 * @param peers The data structure describing the Orthanc peers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6417 * @param peerIndex The index of the peer of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6418 * This value must be lower than OrthancPluginGetPeersCount().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6419 * @result The symbolic name, or NULL in the case of an error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6420 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6421 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6422 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerName(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6423 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6424 const OrthancPluginPeers* peers,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6425 uint32_t peerIndex)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6426 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6427 const char* target = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6428
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6429 _OrthancPluginGetPeerProperty params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6430 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6431 params.target = &target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6432 params.peers = peers;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6433 params.peerIndex = peerIndex;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6434 params.userProperty = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6435
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6436 if (context->InvokeService(context, _OrthancPluginService_GetPeerName, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6437 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6438 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6439 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6440 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6441 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6442 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6443 return target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6444 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6445 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6446
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6447
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6448 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6449 * @brief Get the base URL of an Orthanc peer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6450 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6451 * This function returns the base URL to the REST API of some Orthanc peer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6452 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6453 * This function is thread-safe: Several threads sharing the same
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6454 * OrthancPluginPeers object can simultaneously call this function.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6455 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6456 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6457 * @param peers The data structure describing the Orthanc peers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6458 * @param peerIndex The index of the peer of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6459 * This value must be lower than OrthancPluginGetPeersCount().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6460 * @result The URL, or NULL in the case of an error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6461 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6462 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6463 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerUrl(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6464 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6465 const OrthancPluginPeers* peers,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6466 uint32_t peerIndex)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6467 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6468 const char* target = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6469
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6470 _OrthancPluginGetPeerProperty params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6471 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6472 params.target = &target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6473 params.peers = peers;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6474 params.peerIndex = peerIndex;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6475 params.userProperty = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6476
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6477 if (context->InvokeService(context, _OrthancPluginService_GetPeerUrl, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6478 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6479 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6480 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6481 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6482 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6483 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6484 return target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6485 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6486 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6487
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6488
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6489
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6490 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6491 * @brief Get some user-defined property of an Orthanc peer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6492 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6493 * This function returns some user-defined property of some Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6494 * peer. An user-defined property is a property that is associated
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6495 * with the peer in the Orthanc configuration file, but that is not
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6496 * recognized by the Orthanc core.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6497 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6498 * This function is thread-safe: Several threads sharing the same
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6499 * OrthancPluginPeers object can simultaneously call this function.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6500 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6501 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6502 * @param peers The data structure describing the Orthanc peers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6503 * @param peerIndex The index of the peer of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6504 * This value must be lower than OrthancPluginGetPeersCount().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6505 * @param userProperty The user property of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6506 * @result The value of the user property, or NULL if it is not defined.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6507 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6508 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6509 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerUserProperty(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6510 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6511 const OrthancPluginPeers* peers,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6512 uint32_t peerIndex,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6513 const char* userProperty)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6514 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6515 const char* target = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6516
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6517 _OrthancPluginGetPeerProperty params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6518 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6519 params.target = &target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6520 params.peers = peers;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6521 params.peerIndex = peerIndex;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6522 params.userProperty = userProperty;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6523
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6524 if (context->InvokeService(context, _OrthancPluginService_GetPeerUserProperty, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6525 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6526 /* No such user property */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6527 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6528 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6529 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6530 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6531 return target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6532 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6533 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6534
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6535
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6536
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6537 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6538 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6539 OrthancPluginMemoryBuffer* answerBody;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6540 OrthancPluginMemoryBuffer* answerHeaders;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6541 uint16_t* httpStatus;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6542 const OrthancPluginPeers* peers;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6543 uint32_t peerIndex;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6544 OrthancPluginHttpMethod method;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6545 const char* uri;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6546 uint32_t additionalHeadersCount;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6547 const char* const* additionalHeadersKeys;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6548 const char* const* additionalHeadersValues;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6549 const void* body;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6550 uint32_t bodySize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6551 uint32_t timeout;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6552 } _OrthancPluginCallPeerApi;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6553
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6554 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6555 * @brief Call the REST API of an Orthanc peer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6556 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6557 * Make a REST call to the given URI in the REST API of a remote
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6558 * Orthanc peer. The result to the query is stored into a newly
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6559 * allocated memory buffer. The HTTP request will be done according
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6560 * to the "OrthancPeers" configuration option of Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6561 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6562 * This function is thread-safe: Several threads sharing the same
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6563 * OrthancPluginPeers object can simultaneously call this function.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6564 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6565 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6566 * @param answerBody The target memory buffer (out argument).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6567 * It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6568 * The value of this argument is ignored if the HTTP method is DELETE.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6569 * @param answerHeaders The target memory buffer for the HTTP headers in the answers (out argument).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6570 * The answer headers are formatted as a JSON object (associative array).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6571 * The buffer must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6572 * This argument can be set to NULL if the plugin has no interest in the HTTP headers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6573 * @param httpStatus The HTTP status after the execution of the request (out argument).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6574 * @param peers The data structure describing the Orthanc peers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6575 * @param peerIndex The index of the peer of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6576 * This value must be lower than OrthancPluginGetPeersCount().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6577 * @param method HTTP method to be used.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6578 * @param uri The URI of interest in the REST API.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6579 * @param additionalHeadersCount The number of HTTP headers to be added to the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6580 * HTTP headers provided in the global configuration of Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6581 * @param additionalHeadersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6582 * @param additionalHeadersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6583 * @param body The HTTP body for a POST or PUT request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6584 * @param bodySize The size of the body.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6585 * @param timeout Timeout in seconds (0 for default timeout).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6586 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6587 * @see OrthancPluginHttpClient()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6588 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6589 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6590 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCallPeerApi(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6591 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6592 OrthancPluginMemoryBuffer* answerBody,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6593 OrthancPluginMemoryBuffer* answerHeaders,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6594 uint16_t* httpStatus,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6595 const OrthancPluginPeers* peers,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6596 uint32_t peerIndex,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6597 OrthancPluginHttpMethod method,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6598 const char* uri,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6599 uint32_t additionalHeadersCount,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6600 const char* const* additionalHeadersKeys,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6601 const char* const* additionalHeadersValues,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6602 const void* body,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6603 uint32_t bodySize,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6604 uint32_t timeout)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6605 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6606 _OrthancPluginCallPeerApi params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6607 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6608
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6609 params.answerBody = answerBody;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6610 params.answerHeaders = answerHeaders;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6611 params.httpStatus = httpStatus;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6612 params.peers = peers;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6613 params.peerIndex = peerIndex;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6614 params.method = method;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6615 params.uri = uri;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6616 params.additionalHeadersCount = additionalHeadersCount;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6617 params.additionalHeadersKeys = additionalHeadersKeys;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6618 params.additionalHeadersValues = additionalHeadersValues;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6619 params.body = body;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6620 params.bodySize = bodySize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6621 params.timeout = timeout;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6622
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6623 return context->InvokeService(context, _OrthancPluginService_CallPeerApi, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6624 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6625
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6626
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6627
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6628
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6629
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6630 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6631 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6632 OrthancPluginJob** target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6633 void *job;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6634 OrthancPluginJobFinalize finalize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6635 const char *type;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6636 OrthancPluginJobGetProgress getProgress;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6637 OrthancPluginJobGetContent getContent;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6638 OrthancPluginJobGetSerialized getSerialized;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6639 OrthancPluginJobStep step;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6640 OrthancPluginJobStop stop;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6641 OrthancPluginJobReset reset;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6642 } _OrthancPluginCreateJob;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6643
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6644 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6645 * @brief Create a custom job.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6646 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6647 * This function creates a custom job to be run by the jobs engine
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6648 * of Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6649 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6650 * Orthanc starts one dedicated thread per custom job that is
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6651 * running. It is guaranteed that all the callbacks will only be
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6652 * called from this single dedicated thread, in mutual exclusion: As
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6653 * a consequence, it is *not* mandatory to protect the various
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6654 * callbacks by mutexes.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6655 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6656 * The custom job can nonetheless launch its own processing threads
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6657 * on the first call to the "step()" callback, and stop them once
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6658 * the "stop()" callback is called.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6659 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6660 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6661 * @param job The job to be executed.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6662 * @param finalize The finalization callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6663 * @param type The type of the job, provided to the job unserializer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6664 * See OrthancPluginRegisterJobsUnserializer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6665 * @param getProgress The progress callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6666 * @param getContent The content callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6667 * @param getSerialized The serialization callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6668 * @param step The callback to execute the individual steps of the job.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6669 * @param stop The callback that is invoked once the job leaves the "running" state.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6670 * @param reset The callback that is invoked if a stopped job is started again.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6671 * @return The newly allocated job. It must be freed with OrthancPluginFreeJob(),
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6672 * as long as it is not submitted with OrthancPluginSubmitJob().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6673 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6674 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6675 ORTHANC_PLUGIN_INLINE OrthancPluginJob *OrthancPluginCreateJob(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6676 OrthancPluginContext *context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6677 void *job,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6678 OrthancPluginJobFinalize finalize,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6679 const char *type,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6680 OrthancPluginJobGetProgress getProgress,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6681 OrthancPluginJobGetContent getContent,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6682 OrthancPluginJobGetSerialized getSerialized,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6683 OrthancPluginJobStep step,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6684 OrthancPluginJobStop stop,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6685 OrthancPluginJobReset reset)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6686 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6687 OrthancPluginJob* target = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6688
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6689 _OrthancPluginCreateJob params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6690 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6691
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6692 params.target = &target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6693 params.job = job;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6694 params.finalize = finalize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6695 params.type = type;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6696 params.getProgress = getProgress;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6697 params.getContent = getContent;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6698 params.getSerialized = getSerialized;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6699 params.step = step;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6700 params.stop = stop;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6701 params.reset = reset;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6702
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6703 if (context->InvokeService(context, _OrthancPluginService_CreateJob, &params) != OrthancPluginErrorCode_Success ||
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6704 target == NULL)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6705 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6706 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6707 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6708 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6709 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6710 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6711 return target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6712 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6713 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6714
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6715
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6716 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6717 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6718 OrthancPluginJob* job;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6719 } _OrthancPluginFreeJob;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6720
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6721 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6722 * @brief Free a custom job.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6723 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6724 * This function frees an image that was created with OrthancPluginCreateJob().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6725 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6726 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6727 * @param job The job.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6728 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6729 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6730 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeJob(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6731 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6732 OrthancPluginJob* job)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6733 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6734 _OrthancPluginFreeJob params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6735 params.job = job;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6736
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6737 context->InvokeService(context, _OrthancPluginService_FreeJob, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6738 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6739
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6740
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6741
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6742 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6743 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6744 char** resultId;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6745 OrthancPluginJob *job;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6746 int priority;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6747 } _OrthancPluginSubmitJob;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6748
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6749 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6750 * @brief Submit a new job to the jobs engine of Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6751 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6752 * This function adds the given job to the pending jobs of
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6753 * Orthanc. Orthanc will take take of freeing it by invoking the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6754 * finalization callback provided to OrthancPluginCreateJob().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6755 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6756 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6757 * @param job The job, as received by OrthancPluginCreateJob().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6758 * @param priority The priority of the job.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6759 * @return ID of the newly-submitted job. This string must be freed by OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6760 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6761 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6762 ORTHANC_PLUGIN_INLINE char *OrthancPluginSubmitJob(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6763 OrthancPluginContext *context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6764 OrthancPluginJob *job,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6765 int priority)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6766 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6767 char* resultId = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6768
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6769 _OrthancPluginSubmitJob params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6770 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6771
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6772 params.resultId = &resultId;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6773 params.job = job;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6774 params.priority = priority;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6775
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6776 if (context->InvokeService(context, _OrthancPluginService_SubmitJob, &params) != OrthancPluginErrorCode_Success ||
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6777 resultId == NULL)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6778 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6779 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6780 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6781 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6782 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6783 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6784 return resultId;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6785 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6786 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6787
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6788
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6789
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6790 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6791 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6792 OrthancPluginJobsUnserializer unserializer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6793 } _OrthancPluginJobsUnserializer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6794
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6795 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6796 * @brief Register an unserializer for custom jobs.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6797 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6798 * This function registers an unserializer that decodes custom jobs
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6799 * from a JSON string. This callback is invoked when the jobs engine
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6800 * of Orthanc is started (on Orthanc initialization), for each job
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6801 * that is stored in the Orthanc database.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6802 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6803 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6804 * @param unserializer The job unserializer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6805 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6806 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6807 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterJobsUnserializer(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6808 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6809 OrthancPluginJobsUnserializer unserializer)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6810 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6811 _OrthancPluginJobsUnserializer params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6812 params.unserializer = unserializer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6813
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6814 context->InvokeService(context, _OrthancPluginService_RegisterJobsUnserializer, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6815 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6816
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6817
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6818
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6819 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6820 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6821 OrthancPluginRestOutput* output;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6822 const char* details;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6823 uint8_t log;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6824 } _OrthancPluginSetHttpErrorDetails;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6825
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6826 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6827 * @brief Provide a detailed description for an HTTP error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6828 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6829 * This function sets the detailed description associated with an
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6830 * HTTP error. This description will be displayed in the "Details"
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6831 * field of the JSON body of the HTTP answer. It is only taken into
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6832 * consideration if the REST callback returns an error code that is
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6833 * different from "OrthancPluginErrorCode_Success", and if the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6834 * "HttpDescribeErrors" configuration option of Orthanc is set to
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6835 * "true".
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6836 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6837 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6838 * @param output The HTTP connection to the client application.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6839 * @param details The details of the error message.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6840 * @param log Whether to also write the detailed error to the Orthanc logs.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6841 * @ingroup REST
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6842 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6843 ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpErrorDetails(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6844 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6845 OrthancPluginRestOutput* output,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6846 const char* details,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6847 uint8_t log)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6848 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6849 _OrthancPluginSetHttpErrorDetails params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6850 params.output = output;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6851 params.details = details;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6852 params.log = log;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6853 context->InvokeService(context, _OrthancPluginService_SetHttpErrorDetails, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6854 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6855
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6856
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6857
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6858 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6859 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6860 const char** result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6861 const char* argument;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6862 } _OrthancPluginRetrieveStaticString;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6863
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6864 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6865 * @brief Detect the MIME type of a file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6866 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6867 * This function returns the MIME type of a file by inspecting its extension.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6868 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6869 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6870 * @param path Path to the file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6871 * @return The MIME type. This is a statically-allocated
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6872 * string, do not free it.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6873 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6874 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6875 ORTHANC_PLUGIN_INLINE const char* OrthancPluginAutodetectMimeType(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6876 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6877 const char* path)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6878 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6879 const char* result = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6880
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6881 _OrthancPluginRetrieveStaticString params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6882 params.result = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6883 params.argument = path;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6884
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6885 if (context->InvokeService(context, _OrthancPluginService_AutodetectMimeType, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6886 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6887 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6888 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6889 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6890 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6891 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6892 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6893 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6894 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6895
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6896
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6897
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6898 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6899 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6900 const char* name;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6901 float value;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6902 OrthancPluginMetricsType type;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6903 } _OrthancPluginSetMetricsValue;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6904
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6905 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6906 * @brief Set the value of a metrics.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6907 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6908 * This function sets the value of a metrics to monitor the behavior
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6909 * of the plugin through tools such as Prometheus. The values of all
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6910 * the metrics are stored within the Orthanc context.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6911 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6912 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6913 * @param name The name of the metrics to be set.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6914 * @param value The value of the metrics.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6915 * @param type The type of the metrics. This parameter is only taken into consideration
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6916 * the first time this metrics is set.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6917 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6918 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6919 ORTHANC_PLUGIN_INLINE void OrthancPluginSetMetricsValue(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6920 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6921 const char* name,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6922 float value,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6923 OrthancPluginMetricsType type)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6924 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6925 _OrthancPluginSetMetricsValue params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6926 params.name = name;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6927 params.value = value;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6928 params.type = type;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6929 context->InvokeService(context, _OrthancPluginService_SetMetricsValue, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6930 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6931
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6932
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6933
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6934 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6935 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6936 OrthancPluginRefreshMetricsCallback callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6937 } _OrthancPluginRegisterRefreshMetricsCallback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6938
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6939 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6940 * @brief Register a callback to refresh the metrics.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6941 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6942 * This function registers a callback to refresh the metrics. The
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6943 * callback must make calls to OrthancPluginSetMetricsValue().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6944 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6945 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6946 * @param callback The callback function to handle the refresh.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6947 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6948 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6949 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRefreshMetricsCallback(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6950 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6951 OrthancPluginRefreshMetricsCallback callback)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6952 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6953 _OrthancPluginRegisterRefreshMetricsCallback params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6954 params.callback = callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6955 context->InvokeService(context, _OrthancPluginService_RegisterRefreshMetricsCallback, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6956 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6957
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6958
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6959
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6960
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6961 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6962 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6963 char** target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6964 const void* dicom;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6965 uint32_t dicomSize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6966 OrthancPluginDicomWebBinaryCallback callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6967 } _OrthancPluginEncodeDicomWeb;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6968
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6969 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6970 * @brief Convert a DICOM instance to DICOMweb JSON.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6971 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6972 * This function converts a memory buffer containing a DICOM instance,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6973 * into its DICOMweb JSON representation.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6974 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6975 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6976 * @param dicom Pointer to the DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6977 * @param dicomSize Size of the DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6978 * @param callback Callback to set the value of the binary tags.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6979 * @see OrthancPluginCreateDicom()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6980 * @return The NULL value in case of error, or the JSON document. This string must
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6981 * be freed by OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6982 * @deprecated OrthancPluginEncodeDicomWebJson2()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6983 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6984 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6985 ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebJson(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6986 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6987 const void* dicom,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6988 uint32_t dicomSize,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6989 OrthancPluginDicomWebBinaryCallback callback)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6990 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6991 char* target = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6992
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6993 _OrthancPluginEncodeDicomWeb params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6994 params.target = &target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6995 params.dicom = dicom;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6996 params.dicomSize = dicomSize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6997 params.callback = callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6998
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6999 if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebJson, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7000 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7001 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7002 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7003 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7004 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7005 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7006 return target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7007 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7008 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7009
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7010
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7011 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7012 * @brief Convert a DICOM instance to DICOMweb XML.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7013 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7014 * This function converts a memory buffer containing a DICOM instance,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7015 * into its DICOMweb XML representation.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7016 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7017 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7018 * @param dicom Pointer to the DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7019 * @param dicomSize Size of the DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7020 * @param callback Callback to set the value of the binary tags.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7021 * @return The NULL value in case of error, or the XML document. This string must
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7022 * be freed by OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7023 * @see OrthancPluginCreateDicom()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7024 * @deprecated OrthancPluginEncodeDicomWebXml2()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7025 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7026 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7027 ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebXml(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7028 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7029 const void* dicom,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7030 uint32_t dicomSize,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7031 OrthancPluginDicomWebBinaryCallback callback)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7032 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7033 char* target = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7034
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7035 _OrthancPluginEncodeDicomWeb params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7036 params.target = &target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7037 params.dicom = dicom;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7038 params.dicomSize = dicomSize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7039 params.callback = callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7040
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7041 if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebXml, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7042 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7043 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7044 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7045 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7046 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7047 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7048 return target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7049 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7050 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7051
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7052
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7053
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7054 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7055 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7056 char** target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7057 const void* dicom;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7058 uint32_t dicomSize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7059 OrthancPluginDicomWebBinaryCallback2 callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7060 void* payload;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7061 } _OrthancPluginEncodeDicomWeb2;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7062
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7063 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7064 * @brief Convert a DICOM instance to DICOMweb JSON.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7065 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7066 * This function converts a memory buffer containing a DICOM instance,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7067 * into its DICOMweb JSON representation.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7068 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7069 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7070 * @param dicom Pointer to the DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7071 * @param dicomSize Size of the DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7072 * @param callback Callback to set the value of the binary tags.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7073 * @param payload User payload.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7074 * @return The NULL value in case of error, or the JSON document. This string must
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7075 * be freed by OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7076 * @see OrthancPluginCreateDicom()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7077 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7078 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7079 ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebJson2(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7080 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7081 const void* dicom,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7082 uint32_t dicomSize,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7083 OrthancPluginDicomWebBinaryCallback2 callback,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7084 void* payload)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7085 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7086 char* target = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7087
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7088 _OrthancPluginEncodeDicomWeb2 params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7089 params.target = &target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7090 params.dicom = dicom;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7091 params.dicomSize = dicomSize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7092 params.callback = callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7093 params.payload = payload;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7094
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7095 if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebJson2, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7096 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7097 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7098 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7099 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7100 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7101 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7102 return target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7103 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7104 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7105
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7106
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7107 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7108 * @brief Convert a DICOM instance to DICOMweb XML.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7109 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7110 * This function converts a memory buffer containing a DICOM instance,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7111 * into its DICOMweb XML representation.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7112 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7113 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7114 * @param dicom Pointer to the DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7115 * @param dicomSize Size of the DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7116 * @param callback Callback to set the value of the binary tags.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7117 * @param payload User payload.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7118 * @return The NULL value in case of error, or the XML document. This string must
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7119 * be freed by OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7120 * @see OrthancPluginCreateDicom()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7121 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7122 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7123 ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebXml2(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7124 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7125 const void* dicom,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7126 uint32_t dicomSize,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7127 OrthancPluginDicomWebBinaryCallback2 callback,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7128 void* payload)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7129 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7130 char* target = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7131
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7132 _OrthancPluginEncodeDicomWeb2 params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7133 params.target = &target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7134 params.dicom = dicom;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7135 params.dicomSize = dicomSize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7136 params.callback = callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7137 params.payload = payload;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7138
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7139 if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebXml2, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7140 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7141 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7142 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7143 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7144 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7145 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7146 return target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7147 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7148 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7149
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7150
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7151
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7152 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7153 * @brief Callback executed when a HTTP header is received during a chunked transfer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7154 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7155 * Signature of a callback function that is called by Orthanc acting
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7156 * as a HTTP client during a chunked HTTP transfer, as soon as it
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7157 * receives one HTTP header from the answer of the remote HTTP
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7158 * server.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7159 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7160 * @see OrthancPluginChunkedHttpClient()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7161 * @param answer The user payload, as provided by the calling plugin.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7162 * @param key The key of the HTTP header.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7163 * @param value The value of the HTTP header.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7164 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7165 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7166 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7167 typedef OrthancPluginErrorCode (*OrthancPluginChunkedClientAnswerAddHeader) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7168 void* answer,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7169 const char* key,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7170 const char* value);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7171
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7172
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7173 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7174 * @brief Callback executed when an answer chunk is received during a chunked transfer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7175 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7176 * Signature of a callback function that is called by Orthanc acting
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7177 * as a HTTP client during a chunked HTTP transfer, as soon as it
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7178 * receives one data chunk from the answer of the remote HTTP
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7179 * server.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7180 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7181 * @see OrthancPluginChunkedHttpClient()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7182 * @param answer The user payload, as provided by the calling plugin.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7183 * @param data The content of the data chunk.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7184 * @param size The size of the data chunk.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7185 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7186 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7187 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7188 typedef OrthancPluginErrorCode (*OrthancPluginChunkedClientAnswerAddChunk) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7189 void* answer,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7190 const void* data,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7191 uint32_t size);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7192
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7193
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7194 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7195 * @brief Callback to know whether the request body is entirely read during a chunked transfer
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7196 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7197 * Signature of a callback function that is called by Orthanc acting
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7198 * as a HTTP client during a chunked HTTP transfer, while reading
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7199 * the body of a POST or PUT request. The plugin must answer "1" as
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7200 * soon as the body is entirely read: The "request" data structure
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7201 * must act as an iterator.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7202 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7203 * @see OrthancPluginChunkedHttpClient()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7204 * @param request The user payload, as provided by the calling plugin.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7205 * @return "1" if the body is over, or "0" if there is still data to be read.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7206 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7207 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7208 typedef uint8_t (*OrthancPluginChunkedClientRequestIsDone) (void* request);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7209
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7210
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7211 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7212 * @brief Callback to advance in the request body during a chunked transfer
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7213 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7214 * Signature of a callback function that is called by Orthanc acting
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7215 * as a HTTP client during a chunked HTTP transfer, while reading
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7216 * the body of a POST or PUT request. This function asks the plugin
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7217 * to advance to the next chunk of data of the request body: The
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7218 * "request" data structure must act as an iterator.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7219 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7220 * @see OrthancPluginChunkedHttpClient()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7221 * @param request The user payload, as provided by the calling plugin.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7222 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7223 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7224 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7225 typedef OrthancPluginErrorCode (*OrthancPluginChunkedClientRequestNext) (void* request);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7226
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7227
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7228 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7229 * @brief Callback to read the current chunk of the request body during a chunked transfer
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7230 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7231 * Signature of a callback function that is called by Orthanc acting
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7232 * as a HTTP client during a chunked HTTP transfer, while reading
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7233 * the body of a POST or PUT request. The plugin must provide the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7234 * content of the current chunk of data of the request body.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7235 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7236 * @see OrthancPluginChunkedHttpClient()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7237 * @param request The user payload, as provided by the calling plugin.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7238 * @return The content of the current request chunk.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7239 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7240 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7241 typedef const void* (*OrthancPluginChunkedClientRequestGetChunkData) (void* request);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7242
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7243
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7244 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7245 * @brief Callback to read the size of the current request chunk during a chunked transfer
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7246 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7247 * Signature of a callback function that is called by Orthanc acting
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7248 * as a HTTP client during a chunked HTTP transfer, while reading
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7249 * the body of a POST or PUT request. The plugin must provide the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7250 * size of the current chunk of data of the request body.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7251 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7252 * @see OrthancPluginChunkedHttpClient()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7253 * @param request The user payload, as provided by the calling plugin.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7254 * @return The size of the current request chunk.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7255 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7256 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7257 typedef uint32_t (*OrthancPluginChunkedClientRequestGetChunkSize) (void* request);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7258
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7259
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7260 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7261 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7262 void* answer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7263 OrthancPluginChunkedClientAnswerAddChunk answerAddChunk;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7264 OrthancPluginChunkedClientAnswerAddHeader answerAddHeader;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7265 uint16_t* httpStatus;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7266 OrthancPluginHttpMethod method;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7267 const char* url;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7268 uint32_t headersCount;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7269 const char* const* headersKeys;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7270 const char* const* headersValues;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7271 void* request;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7272 OrthancPluginChunkedClientRequestIsDone requestIsDone;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7273 OrthancPluginChunkedClientRequestGetChunkData requestChunkData;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7274 OrthancPluginChunkedClientRequestGetChunkSize requestChunkSize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7275 OrthancPluginChunkedClientRequestNext requestNext;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7276 const char* username;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7277 const char* password;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7278 uint32_t timeout;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7279 const char* certificateFile;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7280 const char* certificateKeyFile;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7281 const char* certificateKeyPassword;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7282 uint8_t pkcs11;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7283 } _OrthancPluginChunkedHttpClient;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7284
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7285
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7286 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7287 * @brief Issue a HTTP call, using chunked HTTP transfers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7288 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7289 * Make a HTTP call to the given URL using chunked HTTP
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7290 * transfers. The request body is provided as an iterator over data
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7291 * chunks. The answer is provided as a sequence of function calls
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7292 * with the individual HTTP headers and answer chunks.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7293 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7294 * Contrarily to OrthancPluginHttpClient() that entirely stores the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7295 * request body and the answer body in memory buffers, this function
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7296 * uses chunked HTTP transfers. This results in a lower memory
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7297 * consumption. Pay attention to the fact that Orthanc servers with
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7298 * version <= 1.5.6 do not support chunked transfers: You must use
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7299 * OrthancPluginHttpClient() if contacting such older servers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7300 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7301 * The HTTP request will be done accordingly to the global
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7302 * configuration of Orthanc (in particular, the options "HttpProxy",
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7303 * "HttpTimeout", "HttpsVerifyPeers", "HttpsCACertificates", and
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7304 * "Pkcs11" will be taken into account).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7305 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7306 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7307 * @param answer The user payload for the answer body. It will be provided to the callbacks for the answer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7308 * @param answerAddChunk Callback function to report a data chunk from the answer body.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7309 * @param answerAddHeader Callback function to report an HTTP header sent by the remote server.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7310 * @param httpStatus The HTTP status after the execution of the request (out argument).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7311 * @param method HTTP method to be used.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7312 * @param url The URL of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7313 * @param headersCount The number of HTTP headers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7314 * @param headersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7315 * @param headersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7316 * @param request The user payload containing the request body, and acting as an iterator.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7317 * It will be provided to the callbacks for the request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7318 * @param requestIsDone Callback function to tell whether the request body is entirely read.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7319 * @param requestChunkData Callback function to get the content of the current data chunk of the request body.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7320 * @param requestChunkSize Callback function to get the size of the current data chunk of the request body.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7321 * @param requestNext Callback function to advance to the next data chunk of the request body.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7322 * @param username The username (can be <tt>NULL</tt> if no password protection).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7323 * @param password The password (can be <tt>NULL</tt> if no password protection).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7324 * @param timeout Timeout in seconds (0 for default timeout).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7325 * @param certificateFile Path to the client certificate for HTTPS, in PEM format
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7326 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7327 * @param certificateKeyFile Path to the key of the client certificate for HTTPS, in PEM format
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7328 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7329 * @param certificateKeyPassword Password to unlock the key of the client certificate
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7330 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7331 * @param pkcs11 Enable PKCS#11 client authentication for hardware security modules and smart cards.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7332 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7333 * @see OrthancPluginHttpClient()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7334 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7335 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7336 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginChunkedHttpClient(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7337 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7338 void* answer,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7339 OrthancPluginChunkedClientAnswerAddChunk answerAddChunk,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7340 OrthancPluginChunkedClientAnswerAddHeader answerAddHeader,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7341 uint16_t* httpStatus,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7342 OrthancPluginHttpMethod method,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7343 const char* url,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7344 uint32_t headersCount,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7345 const char* const* headersKeys,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7346 const char* const* headersValues,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7347 void* request,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7348 OrthancPluginChunkedClientRequestIsDone requestIsDone,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7349 OrthancPluginChunkedClientRequestGetChunkData requestChunkData,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7350 OrthancPluginChunkedClientRequestGetChunkSize requestChunkSize,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7351 OrthancPluginChunkedClientRequestNext requestNext,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7352 const char* username,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7353 const char* password,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7354 uint32_t timeout,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7355 const char* certificateFile,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7356 const char* certificateKeyFile,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7357 const char* certificateKeyPassword,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7358 uint8_t pkcs11)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7359 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7360 _OrthancPluginChunkedHttpClient params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7361 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7362
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7363 /* In common with OrthancPluginHttpClient() */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7364 params.httpStatus = httpStatus;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7365 params.method = method;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7366 params.url = url;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7367 params.headersCount = headersCount;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7368 params.headersKeys = headersKeys;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7369 params.headersValues = headersValues;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7370 params.username = username;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7371 params.password = password;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7372 params.timeout = timeout;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7373 params.certificateFile = certificateFile;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7374 params.certificateKeyFile = certificateKeyFile;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7375 params.certificateKeyPassword = certificateKeyPassword;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7376 params.pkcs11 = pkcs11;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7377
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7378 /* For chunked body/answer */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7379 params.answer = answer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7380 params.answerAddChunk = answerAddChunk;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7381 params.answerAddHeader = answerAddHeader;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7382 params.request = request;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7383 params.requestIsDone = requestIsDone;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7384 params.requestChunkData = requestChunkData;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7385 params.requestChunkSize = requestChunkSize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7386 params.requestNext = requestNext;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7387
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7388 return context->InvokeService(context, _OrthancPluginService_ChunkedHttpClient, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7389 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7390
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7391
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7392
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7393 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7394 * @brief Opaque structure that reads the content of a HTTP request body during a chunked HTTP transfer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7395 * @ingroup Callback
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7396 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7397 typedef struct _OrthancPluginServerChunkedRequestReader_t OrthancPluginServerChunkedRequestReader;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7398
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7399
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7400
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7401 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7402 * @brief Callback to create a reader to handle incoming chunked HTTP transfers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7403 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7404 * Signature of a callback function that is called by Orthanc acting
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7405 * as a HTTP server that supports chunked HTTP transfers. This
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7406 * callback is only invoked if the HTTP method is POST or PUT. The
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7407 * callback must create an user-specific "reader" object that will
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7408 * be fed with the body of the incoming body.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7409 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7410 * @see OrthancPluginRegisterChunkedRestCallback()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7411 * @param reader Memory location that must be filled with the newly-created reader.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7412 * @param url The URI that is accessed.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7413 * @param request The body of the HTTP request. Note that "body" and "bodySize" are not used.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7414 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7415 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7416 typedef OrthancPluginErrorCode (*OrthancPluginServerChunkedRequestReaderFactory) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7417 OrthancPluginServerChunkedRequestReader** reader,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7418 const char* url,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7419 const OrthancPluginHttpRequest* request);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7420
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7421
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7422 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7423 * @brief Callback invoked whenever a new data chunk is available during a chunked transfer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7424 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7425 * Signature of a callback function that is called by Orthanc acting
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7426 * as a HTTP server that supports chunked HTTP transfers. This callback
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7427 * is invoked as soon as a new data chunk is available for the request body.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7428 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7429 * @see OrthancPluginRegisterChunkedRestCallback()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7430 * @param reader The user payload, as created by the OrthancPluginServerChunkedRequestReaderFactory() callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7431 * @param data The content of the data chunk.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7432 * @param size The size of the data chunk.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7433 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7434 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7435 typedef OrthancPluginErrorCode (*OrthancPluginServerChunkedRequestReaderAddChunk) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7436 OrthancPluginServerChunkedRequestReader* reader,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7437 const void* data,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7438 uint32_t size);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7439
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7440
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7441 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7442 * @brief Callback invoked whenever the request body is entirely received.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7443 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7444 * Signature of a callback function that is called by Orthanc acting
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7445 * as a HTTP server that supports chunked HTTP transfers. This
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7446 * callback is invoked as soon as the full body of the HTTP request
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7447 * is available. The plugin can then send its answer thanks to the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7448 * provided "output" object.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7449 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7450 * @see OrthancPluginRegisterChunkedRestCallback()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7451 * @param reader The user payload, as created by the OrthancPluginServerChunkedRequestReaderFactory() callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7452 * @param output The HTTP connection to the client application.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7453 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7454 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7455 typedef OrthancPluginErrorCode (*OrthancPluginServerChunkedRequestReaderExecute) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7456 OrthancPluginServerChunkedRequestReader* reader,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7457 OrthancPluginRestOutput* output);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7458
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7459
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7460 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7461 * @brief Callback invoked to release the resources associated with an incoming HTTP chunked transfer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7462 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7463 * Signature of a callback function that is called by Orthanc acting
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7464 * as a HTTP server that supports chunked HTTP transfers. This
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7465 * callback is invoked to release all the resources allocated by the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7466 * given reader. Note that this function might be invoked even if
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7467 * the entire body was not read, to deal with client error or
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7468 * disconnection.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7469 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7470 * @see OrthancPluginRegisterChunkedRestCallback()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7471 * @param reader The user payload, as created by the OrthancPluginServerChunkedRequestReaderFactory() callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7472 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7473 typedef void (*OrthancPluginServerChunkedRequestReaderFinalize) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7474 OrthancPluginServerChunkedRequestReader* reader);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7475
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7476 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7477 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7478 const char* pathRegularExpression;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7479 OrthancPluginRestCallback getHandler;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7480 OrthancPluginServerChunkedRequestReaderFactory postHandler;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7481 OrthancPluginRestCallback deleteHandler;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7482 OrthancPluginServerChunkedRequestReaderFactory putHandler;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7483 OrthancPluginServerChunkedRequestReaderAddChunk addChunk;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7484 OrthancPluginServerChunkedRequestReaderExecute execute;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7485 OrthancPluginServerChunkedRequestReaderFinalize finalize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7486 } _OrthancPluginChunkedRestCallback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7487
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7488
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7489 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7490 * @brief Register a REST callback to handle chunked HTTP transfers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7491 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7492 * This function registers a REST callback against a regular
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7493 * expression for a URI. This function must be called during the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7494 * initialization of the plugin, i.e. inside the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7495 * OrthancPluginInitialize() public function.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7496 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7497 * Contrarily to OrthancPluginRegisterRestCallback(), the callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7498 * will NOT be invoked in mutual exclusion, so it is up to the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7499 * plugin to implement the required locking mechanisms.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7500 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7501 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7502 * @param pathRegularExpression Regular expression for the URI. May contain groups.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7503 * @param getHandler The callback function to handle REST calls using the GET HTTP method.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7504 * @param postHandler The callback function to handle REST calls using the GET POST method.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7505 * @param deleteHandler The callback function to handle REST calls using the GET DELETE method.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7506 * @param putHandler The callback function to handle REST calls using the GET PUT method.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7507 * @param addChunk The callback invoked when a new chunk is available for the request body of a POST or PUT call.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7508 * @param execute The callback invoked once the entire body of a POST or PUT call is read.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7509 * @param finalize The callback invoked to release the resources associated with a POST or PUT call.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7510 * @see OrthancPluginRegisterRestCallbackNoLock()
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7511 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7512 * @note
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7513 * The regular expression is case sensitive and must follow the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7514 * [Perl syntax](https://www.boost.org/doc/libs/1_67_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7515 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7516 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7517 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7518 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterChunkedRestCallback(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7519 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7520 const char* pathRegularExpression,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7521 OrthancPluginRestCallback getHandler,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7522 OrthancPluginServerChunkedRequestReaderFactory postHandler,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7523 OrthancPluginRestCallback deleteHandler,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7524 OrthancPluginServerChunkedRequestReaderFactory putHandler,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7525 OrthancPluginServerChunkedRequestReaderAddChunk addChunk,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7526 OrthancPluginServerChunkedRequestReaderExecute execute,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7527 OrthancPluginServerChunkedRequestReaderFinalize finalize)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7528 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7529 _OrthancPluginChunkedRestCallback params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7530 params.pathRegularExpression = pathRegularExpression;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7531 params.getHandler = getHandler;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7532 params.postHandler = postHandler;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7533 params.deleteHandler = deleteHandler;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7534 params.putHandler = putHandler;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7535 params.addChunk = addChunk;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7536 params.execute = execute;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7537 params.finalize = finalize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7538
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7539 context->InvokeService(context, _OrthancPluginService_RegisterChunkedRestCallback, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7540 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7541
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7542
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7543
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7544
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7545
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7546 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7547 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7548 char** result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7549 uint16_t group;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7550 uint16_t element;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7551 const char* privateCreator;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7552 } _OrthancPluginGetTagName;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7553
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7554 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7555 * @brief Returns the symbolic name of a DICOM tag.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7556 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7557 * This function makes a lookup to the dictionary of DICOM tags that
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7558 * are known to Orthanc, and returns the symbolic name of a DICOM tag.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7559 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7560 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7561 * @param group The group of the tag.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7562 * @param element The element of the tag.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7563 * @param privateCreator For private tags, the name of the private creator (can be NULL).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7564 * @return NULL in the case of an error, or a newly allocated string
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7565 * containing the path. This string must be freed by
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7566 * OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7567 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7568 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7569 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetTagName(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7570 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7571 uint16_t group,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7572 uint16_t element,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7573 const char* privateCreator)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7574 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7575 char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7576
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7577 _OrthancPluginGetTagName params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7578 params.result = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7579 params.group = group;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7580 params.element = element;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7581 params.privateCreator = privateCreator;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7582
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7583 if (context->InvokeService(context, _OrthancPluginService_GetTagName, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7584 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7585 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7586 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7587 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7588 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7589 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7590 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7591 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7592 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7593
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7594
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7595
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7596 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7597 * @brief Callback executed by the storage commitment SCP.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7598 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7599 * Signature of a factory function that creates an object to handle
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7600 * one incoming storage commitment request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7601 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7602 * @remark The factory receives the list of the SOP class/instance
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7603 * UIDs of interest to the remote storage commitment SCU. This gives
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7604 * the factory the possibility to start some prefetch process
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7605 * upfront in the background, before the handler object is actually
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7606 * queried about the status of these DICOM instances.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7607 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7608 * @param handler Output variable where the factory puts the handler object it created.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7609 * @param jobId ID of the Orthanc job that is responsible for handling
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7610 * the storage commitment request. This job will successively look for the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7611 * status of all the individual queried DICOM instances.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7612 * @param transactionUid UID of the storage commitment transaction
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7613 * provided by the storage commitment SCU. It contains the value of the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7614 * (0008,1195) DICOM tag.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7615 * @param sopClassUids Array of the SOP class UIDs (0008,0016) that are queried by the SCU.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7616 * @param sopInstanceUids Array of the SOP instance UIDs (0008,0018) that are queried by the SCU.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7617 * @param countInstances Number of DICOM instances that are queried. This is the size
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7618 * of the `sopClassUids` and `sopInstanceUids` arrays.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7619 * @param remoteAet The AET of the storage commitment SCU.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7620 * @param calledAet The AET used by the SCU to contact the storage commitment SCP (i.e. Orthanc).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7621 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7622 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7623 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7624 typedef OrthancPluginErrorCode (*OrthancPluginStorageCommitmentFactory) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7625 void** handler /* out */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7626 const char* jobId,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7627 const char* transactionUid,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7628 const char* const* sopClassUids,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7629 const char* const* sopInstanceUids,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7630 uint32_t countInstances,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7631 const char* remoteAet,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7632 const char* calledAet);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7633
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7634
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7635 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7636 * @brief Callback to free one storage commitment SCP handler.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7637 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7638 * Signature of a callback function that releases the resources
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7639 * allocated by the factory of the storage commitment SCP. The
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7640 * handler is the return value of a previous call to the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7641 * OrthancPluginStorageCommitmentFactory() callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7642 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7643 * @param handler The handler object to be destructed.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7644 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7645 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7646 typedef void (*OrthancPluginStorageCommitmentDestructor) (void* handler);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7647
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7648
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7649 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7650 * @brief Callback to get the status of one DICOM instance in the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7651 * storage commitment SCP.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7652 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7653 * Signature of a callback function that is successively invoked for
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7654 * each DICOM instance that is queried by the remote storage
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7655 * commitment SCU. The function must be tought of as a method of
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7656 * the handler object that was created by a previous call to the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7657 * OrthancPluginStorageCommitmentFactory() callback. After each call
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7658 * to this method, the progress of the associated Orthanc job is
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7659 * updated.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7660 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7661 * @param target Output variable where to put the status for the queried instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7662 * @param handler The handler object associated with this storage commitment request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7663 * @param sopClassUid The SOP class UID (0008,0016) of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7664 * @param sopInstanceUid The SOP instance UID (0008,0018) of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7665 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7666 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7667 typedef OrthancPluginErrorCode (*OrthancPluginStorageCommitmentLookup) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7668 OrthancPluginStorageCommitmentFailureReason* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7669 void* handler,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7670 const char* sopClassUid,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7671 const char* sopInstanceUid);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7672
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7673
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7674 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7675 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7676 OrthancPluginStorageCommitmentFactory factory;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7677 OrthancPluginStorageCommitmentDestructor destructor;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7678 OrthancPluginStorageCommitmentLookup lookup;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7679 } _OrthancPluginRegisterStorageCommitmentScpCallback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7680
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7681 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7682 * @brief Register a callback to handle incoming requests to the storage commitment SCP.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7683 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7684 * This function registers a callback to handle storage commitment SCP requests.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7685 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7686 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7687 * @param factory Factory function that creates the handler object
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7688 * for incoming storage commitment requests.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7689 * @param destructor Destructor function to destroy the handler object.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7690 * @param lookup Callback method to get the status of one DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7691 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7692 * @ingroup DicomCallbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7693 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7694 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterStorageCommitmentScpCallback(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7695 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7696 OrthancPluginStorageCommitmentFactory factory,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7697 OrthancPluginStorageCommitmentDestructor destructor,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7698 OrthancPluginStorageCommitmentLookup lookup)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7699 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7700 _OrthancPluginRegisterStorageCommitmentScpCallback params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7701 params.factory = factory;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7702 params.destructor = destructor;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7703 params.lookup = lookup;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7704 return context->InvokeService(context, _OrthancPluginService_RegisterStorageCommitmentScpCallback, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7705 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7706
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7707
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7708
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7709 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7710 * @brief Callback to filter incoming DICOM instances received by Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7711 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7712 * Signature of a callback function that is triggered whenever
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7713 * Orthanc receives a new DICOM instance (e.g. through REST API or
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7714 * DICOM protocol), and that answers whether this DICOM instance
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7715 * should be accepted or discarded by Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7716 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7717 * Note that the metadata information is not available
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7718 * (i.e. GetInstanceMetadata() should not be used on "instance").
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7719 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7720 * @param instance The received DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7721 * @return 0 to discard the instance, 1 to store the instance, -1 if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7722 * @ingroup Callback
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7723 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7724 typedef int32_t (*OrthancPluginIncomingDicomInstanceFilter) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7725 const OrthancPluginDicomInstance* instance);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7726
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7727
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7728 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7729 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7730 OrthancPluginIncomingDicomInstanceFilter callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7731 } _OrthancPluginIncomingDicomInstanceFilter;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7732
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7733 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7734 * @brief Register a callback to filter incoming DICOM instances.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7735 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7736 * This function registers a custom callback to filter incoming
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7737 * DICOM instances received by Orthanc (either through the REST API
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7738 * or through the DICOM protocol).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7739 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7740 * @warning Your callback function will be called synchronously with
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7741 * the core of Orthanc. This implies that deadlocks might emerge if
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7742 * you call other core primitives of Orthanc in your callback (such
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7743 * deadlocks are particular visible in the presence of other plugins
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7744 * or Lua scripts). It is thus strongly advised to avoid any call to
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7745 * the REST API of Orthanc in the callback. If you have to call
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7746 * other primitives of Orthanc, you should make these calls in a
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7747 * separate thread, passing the pending events to be processed
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7748 * through a message queue.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7749 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7750 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7751 * @param callback The callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7752 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7753 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7754 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7755 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingDicomInstanceFilter(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7756 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7757 OrthancPluginIncomingDicomInstanceFilter callback)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7758 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7759 _OrthancPluginIncomingDicomInstanceFilter params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7760 params.callback = callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7761
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7762 return context->InvokeService(context, _OrthancPluginService_RegisterIncomingDicomInstanceFilter, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7763 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7764
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7765
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7766 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7767 * @brief Get the transfer syntax of a DICOM file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7768 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7769 * This function returns a pointer to a newly created string that
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7770 * contains the transfer syntax UID of the DICOM instance. The empty
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7771 * string might be returned if this information is unknown.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7772 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7773 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7774 * @param instance The instance of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7775 * @return The NULL value in case of error, or a string containing the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7776 * transfer syntax UID. This string must be freed by OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7777 * @ingroup DicomInstance
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7778 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7779 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceTransferSyntaxUid(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7780 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7781 const OrthancPluginDicomInstance* instance)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7782 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7783 char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7784
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7785 _OrthancPluginAccessDicomInstance params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7786 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7787 params.resultStringToFree = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7788 params.instance = instance;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7789
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7790 if (context->InvokeService(context, _OrthancPluginService_GetInstanceTransferSyntaxUid, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7791 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7792 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7793 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7794 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7795 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7796 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7797 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7798 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7799 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7800
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7801
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7802 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7803 * @brief Check whether the DICOM file has pixel data.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7804 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7805 * This function returns a Boolean value indicating whether the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7806 * DICOM instance contains the pixel data (7FE0,0010) tag.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7807 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7808 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7809 * @param instance The instance of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7810 * @return "1" if the DICOM instance contains pixel data, or "0" if
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7811 * the tag is missing, or "-1" in the case of an error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7812 * @ingroup DicomInstance
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7813 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7814 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginHasInstancePixelData(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7815 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7816 const OrthancPluginDicomInstance* instance)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7817 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7818 int64_t hasPixelData;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7819
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7820 _OrthancPluginAccessDicomInstance params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7821 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7822 params.resultInt64 = &hasPixelData;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7823 params.instance = instance;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7824
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7825 if (context->InvokeService(context, _OrthancPluginService_HasInstancePixelData, &params) != OrthancPluginErrorCode_Success ||
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7826 hasPixelData < 0 ||
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7827 hasPixelData > 1)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7828 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7829 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7830 return -1;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7831 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7832 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7833 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7834 return (hasPixelData != 0);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7835 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7836 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7837
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7838
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7839
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7840
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7841
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7842
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7843 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7844 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7845 OrthancPluginDicomInstance** target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7846 const void* buffer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7847 uint32_t size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7848 const char* transferSyntax;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7849 } _OrthancPluginCreateDicomInstance;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7850
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7851 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7852 * @brief Parse a DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7853 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7854 * This function parses a memory buffer that contains a DICOM
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7855 * file. The function returns a new pointer to a data structure that
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7856 * is managed by the Orthanc core.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7857 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7858 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7859 * @param buffer The memory buffer containing the DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7860 * @param size The size of the memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7861 * @return The newly allocated DICOM instance. It must be freed with OrthancPluginFreeDicomInstance().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7862 * @ingroup DicomInstance
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7863 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7864 ORTHANC_PLUGIN_INLINE OrthancPluginDicomInstance* OrthancPluginCreateDicomInstance(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7865 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7866 const void* buffer,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7867 uint32_t size)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7868 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7869 OrthancPluginDicomInstance* target = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7870
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7871 _OrthancPluginCreateDicomInstance params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7872 params.target = &target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7873 params.buffer = buffer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7874 params.size = size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7875
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7876 if (context->InvokeService(context, _OrthancPluginService_CreateDicomInstance, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7877 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7878 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7879 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7880 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7881 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7882 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7883 return target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7884 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7885 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7886
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7887 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7888 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7889 OrthancPluginDicomInstance* dicom;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7890 } _OrthancPluginFreeDicomInstance;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7891
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7892 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7893 * @brief Free a DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7894 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7895 * This function frees a DICOM instance that was parsed using
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7896 * OrthancPluginCreateDicomInstance().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7897 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7898 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7899 * @param dicom The DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7900 * @ingroup DicomInstance
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7901 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7902 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeDicomInstance(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7903 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7904 OrthancPluginDicomInstance* dicom)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7905 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7906 _OrthancPluginFreeDicomInstance params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7907 params.dicom = dicom;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7908
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7909 context->InvokeService(context, _OrthancPluginService_FreeDicomInstance, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7910 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7911
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7912
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7913 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7914 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7915 uint32_t* targetUint32;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7916 OrthancPluginMemoryBuffer* targetBuffer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7917 OrthancPluginImage** targetImage;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7918 char** targetStringToFree;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7919 const OrthancPluginDicomInstance* instance;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7920 uint32_t frameIndex;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7921 OrthancPluginDicomToJsonFormat format;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7922 OrthancPluginDicomToJsonFlags flags;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7923 uint32_t maxStringLength;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7924 OrthancPluginDicomWebBinaryCallback2 dicomWebCallback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7925 void* dicomWebPayload;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7926 } _OrthancPluginAccessDicomInstance2;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7927
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7928 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7929 * @brief Get the number of frames in a DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7930 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7931 * This function returns the number of frames that are part of a
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7932 * DICOM image managed by the Orthanc core.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7933 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7934 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7935 * @param instance The instance of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7936 * @return The number of frames (will be zero in the case of an error).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7937 * @ingroup DicomInstance
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7938 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7939 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetInstanceFramesCount(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7940 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7941 const OrthancPluginDicomInstance* instance)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7942 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7943 uint32_t count;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7944
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7945 _OrthancPluginAccessDicomInstance2 params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7946 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7947 params.targetUint32 = &count;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7948 params.instance = instance;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7949
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7950 if (context->InvokeService(context, _OrthancPluginService_GetInstanceFramesCount, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7951 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7952 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7953 return 0;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7954 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7955 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7956 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7957 return count;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7958 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7959 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7960
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7961
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7962 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7963 * @brief Get the raw content of a frame in a DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7964 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7965 * This function returns a memory buffer containing the raw content
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7966 * of a frame in a DICOM instance that is managed by the Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7967 * core. This is notably useful for compressed transfer syntaxes, as
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7968 * it gives access to the embedded files (such as JPEG, JPEG-LS or
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7969 * JPEG2k). The Orthanc core transparently reassembles the fragments
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7970 * to extract the raw frame.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7971 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7972 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7973 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7974 * @param instance The instance of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7975 * @param frameIndex The index of the frame of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7976 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7977 * @ingroup DicomInstance
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7978 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7979 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetInstanceRawFrame(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7980 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7981 OrthancPluginMemoryBuffer* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7982 const OrthancPluginDicomInstance* instance,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7983 uint32_t frameIndex)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7984 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7985 _OrthancPluginAccessDicomInstance2 params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7986 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7987 params.targetBuffer = target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7988 params.instance = instance;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7989 params.frameIndex = frameIndex;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7990
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7991 return context->InvokeService(context, _OrthancPluginService_GetInstanceRawFrame, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7992 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7993
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7994
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7995 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7996 * @brief Decode one frame from a DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7997 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7998 * This function decodes one frame of a DICOM image that is managed
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7999 * by the Orthanc core.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8000 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8001 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8002 * @param instance The instance of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8003 * @param frameIndex The index of the frame of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8004 * @return The uncompressed image. It must be freed with OrthancPluginFreeImage().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8005 * @ingroup DicomInstance
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8006 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8007 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginGetInstanceDecodedFrame(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8008 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8009 const OrthancPluginDicomInstance* instance,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8010 uint32_t frameIndex)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8011 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8012 OrthancPluginImage* target = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8013
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8014 _OrthancPluginAccessDicomInstance2 params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8015 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8016 params.targetImage = &target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8017 params.instance = instance;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8018 params.frameIndex = frameIndex;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8019
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8020 if (context->InvokeService(context, _OrthancPluginService_GetInstanceDecodedFrame, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8021 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8022 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8023 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8024 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8025 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8026 return target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8027 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8028 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8029
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8030
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8031 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8032 * @brief Parse and transcode a DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8033 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8034 * This function parses a memory buffer that contains a DICOM file,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8035 * then transcodes it to the given transfer syntax. The function
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8036 * returns a new pointer to a data structure that is managed by the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8037 * Orthanc core.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8038 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8039 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8040 * @param buffer The memory buffer containing the DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8041 * @param size The size of the memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8042 * @param transferSyntax The transfer syntax UID for the transcoding.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8043 * @return The newly allocated DICOM instance. It must be freed with OrthancPluginFreeDicomInstance().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8044 * @ingroup DicomInstance
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8045 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8046 ORTHANC_PLUGIN_INLINE OrthancPluginDicomInstance* OrthancPluginTranscodeDicomInstance(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8047 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8048 const void* buffer,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8049 uint32_t size,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8050 const char* transferSyntax)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8051 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8052 OrthancPluginDicomInstance* target = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8053
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8054 _OrthancPluginCreateDicomInstance params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8055 params.target = &target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8056 params.buffer = buffer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8057 params.size = size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8058 params.transferSyntax = transferSyntax;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8059
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8060 if (context->InvokeService(context, _OrthancPluginService_TranscodeDicomInstance, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8061 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8062 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8063 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8064 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8065 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8066 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8067 return target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8068 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8069 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8070
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8071 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8072 * @brief Writes a DICOM instance to a memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8073 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8074 * This function returns a memory buffer containing the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8075 * serialization of a DICOM instance that is managed by the Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8076 * core.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8077 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8078 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8079 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8080 * @param instance The instance of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8081 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8082 * @ingroup DicomInstance
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8083 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8084 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSerializeDicomInstance(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8085 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8086 OrthancPluginMemoryBuffer* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8087 const OrthancPluginDicomInstance* instance)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8088 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8089 _OrthancPluginAccessDicomInstance2 params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8090 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8091 params.targetBuffer = target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8092 params.instance = instance;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8093
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8094 return context->InvokeService(context, _OrthancPluginService_SerializeDicomInstance, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8095 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8096
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8097
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8098 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8099 * @brief Format a DICOM memory buffer as a JSON string.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8100 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8101 * This function takes as DICOM instance managed by the Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8102 * core, and outputs a JSON string representing the tags of this
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8103 * DICOM file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8104 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8105 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8106 * @param instance The DICOM instance of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8107 * @param format The output format.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8108 * @param flags Flags governing the output.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8109 * @param maxStringLength The maximum length of a field. Too long fields will
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8110 * be output as "null". The 0 value means no maximum length.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8111 * @return The NULL value if the case of an error, or the JSON
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8112 * string. This string must be freed by OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8113 * @ingroup DicomInstance
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8114 * @see OrthancPluginDicomBufferToJson
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8115 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8116 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceAdvancedJson(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8117 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8118 const OrthancPluginDicomInstance* instance,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8119 OrthancPluginDicomToJsonFormat format,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8120 OrthancPluginDicomToJsonFlags flags,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8121 uint32_t maxStringLength)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8122 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8123 char* result = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8124
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8125 _OrthancPluginAccessDicomInstance2 params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8126 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8127 params.targetStringToFree = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8128 params.instance = instance;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8129 params.format = format;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8130 params.flags = flags;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8131 params.maxStringLength = maxStringLength;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8132
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8133 if (context->InvokeService(context, _OrthancPluginService_GetInstanceAdvancedJson, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8134 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8135 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8136 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8137 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8138 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8139 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8140 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8141 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8142 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8143
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8144
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8145 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8146 * @brief Convert a DICOM instance to DICOMweb JSON.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8147 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8148 * This function converts a DICOM instance that is managed by the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8149 * Orthanc core, into its DICOMweb JSON representation.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8150 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8151 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8152 * @param instance The DICOM instance of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8153 * @param callback Callback to set the value of the binary tags.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8154 * @param payload User payload.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8155 * @return The NULL value in case of error, or the JSON document. This string must
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8156 * be freed by OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8157 * @ingroup DicomInstance
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8158 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8159 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceDicomWebJson(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8160 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8161 const OrthancPluginDicomInstance* instance,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8162 OrthancPluginDicomWebBinaryCallback2 callback,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8163 void* payload)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8164 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8165 char* target = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8166
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8167 _OrthancPluginAccessDicomInstance2 params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8168 params.targetStringToFree = &target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8169 params.instance = instance;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8170 params.dicomWebCallback = callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8171 params.dicomWebPayload = payload;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8172
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8173 if (context->InvokeService(context, _OrthancPluginService_GetInstanceDicomWebJson, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8174 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8175 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8176 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8177 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8178 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8179 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8180 return target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8181 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8182 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8183
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8184
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8185 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8186 * @brief Convert a DICOM instance to DICOMweb XML.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8187 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8188 * This function converts a DICOM instance that is managed by the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8189 * Orthanc core, into its DICOMweb XML representation.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8190 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8191 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8192 * @param instance The DICOM instance of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8193 * @param callback Callback to set the value of the binary tags.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8194 * @param payload User payload.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8195 * @return The NULL value in case of error, or the XML document. This string must
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8196 * be freed by OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8197 * @ingroup DicomInstance
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8198 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8199 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceDicomWebXml(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8200 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8201 const OrthancPluginDicomInstance* instance,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8202 OrthancPluginDicomWebBinaryCallback2 callback,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8203 void* payload)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8204 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8205 char* target = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8206
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8207 _OrthancPluginAccessDicomInstance2 params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8208 params.targetStringToFree = &target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8209 params.instance = instance;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8210 params.dicomWebCallback = callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8211 params.dicomWebPayload = payload;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8212
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8213 if (context->InvokeService(context, _OrthancPluginService_GetInstanceDicomWebXml, &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8214 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8215 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8216 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8217 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8218 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8219 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8220 return target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8221 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8222 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8223
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8224
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8225
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8226 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8227 * @brief Signature of a callback function to transcode a DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8228 * @param transcoded Target memory buffer. It must be allocated by the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8229 * plugin using OrthancPluginCreateMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8230 * @param buffer Memory buffer containing the source DICOM instance.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8231 * @param size Size of the source memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8232 * @param allowedSyntaxes A C array of possible transfer syntaxes UIDs for the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8233 * result of the transcoding. The plugin must choose by itself the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8234 * transfer syntax that will be used for the resulting DICOM image.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8235 * @param countSyntaxes The number of transfer syntaxes that are contained
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8236 * in the "allowedSyntaxes" array.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8237 * @param allowNewSopInstanceUid Whether the transcoding plugin can select
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8238 * a transfer syntax that will change the SOP instance UID (or, in other
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8239 * terms, whether the plugin can transcode using lossy compression).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8240 * @return 0 if success (i.e. image successfully transcoded and stored into
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8241 * "transcoded"), or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8242 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8243 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8244 typedef OrthancPluginErrorCode (*OrthancPluginTranscoderCallback) (
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8245 OrthancPluginMemoryBuffer* transcoded /* out */,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8246 const void* buffer,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8247 uint64_t size,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8248 const char* const* allowedSyntaxes,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8249 uint32_t countSyntaxes,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8250 uint8_t allowNewSopInstanceUid);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8251
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8252
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8253 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8254 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8255 OrthancPluginTranscoderCallback callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8256 } _OrthancPluginTranscoderCallback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8257
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8258 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8259 * @brief Register a callback to handle the transcoding of DICOM images.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8260 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8261 * This function registers a custom callback to transcode DICOM
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8262 * images, extending the built-in transcoder of Orthanc that uses
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8263 * DCMTK. The exact behavior is affected by the configuration option
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8264 * "BuiltinDecoderTranscoderOrder" of Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8265 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8266 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8267 * @param callback The callback.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8268 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8269 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8270 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8271 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterTranscoderCallback(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8272 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8273 OrthancPluginTranscoderCallback callback)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8274 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8275 _OrthancPluginTranscoderCallback params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8276 params.callback = callback;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8277
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8278 return context->InvokeService(context, _OrthancPluginService_RegisterTranscoderCallback, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8279 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8280
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8281
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8282
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8283 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8284 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8285 OrthancPluginMemoryBuffer* target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8286 uint32_t size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8287 } _OrthancPluginCreateMemoryBuffer;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8288
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8289 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8290 * @brief Create a 32-bit memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8291 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8292 * This function creates a memory buffer that is managed by the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8293 * Orthanc core. The main use case of this function is for plugins
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8294 * that act as DICOM transcoders.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8295 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8296 * Your plugin should never call "free()" on the resulting memory
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8297 * buffer, as the C library that is used by the plugin is in general
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8298 * not the same as the one used by the Orthanc core.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8299 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8300 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8301 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8302 * @param size Size of the memory buffer to be created.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8303 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8304 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8305 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8306 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCreateMemoryBuffer(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8307 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8308 OrthancPluginMemoryBuffer* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8309 uint32_t size)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8310 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8311 _OrthancPluginCreateMemoryBuffer params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8312 params.target = target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8313 params.size = size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8314
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8315 return context->InvokeService(context, _OrthancPluginService_CreateMemoryBuffer, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8316 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8317
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8318
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8319 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8320 * @brief Generate a token to grant full access to the REST API of Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8321 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8322 * This function generates a token that can be set in the HTTP
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8323 * header "Authorization" so as to grant full access to the REST API
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8324 * of Orthanc using an external HTTP client. Using this function
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8325 * avoids the need of adding a separate user in the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8326 * "RegisteredUsers" configuration of Orthanc, which eases
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8327 * deployments.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8328 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8329 * This feature is notably useful in multiprocess scenarios, where a
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8330 * subprocess created by a plugin has no access to the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8331 * "OrthancPluginContext", and thus cannot call
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8332 * "OrthancPluginRestApi[Get|Post|Put|Delete]()".
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8333 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8334 * This situation is frequently encountered in Python plugins, where
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8335 * the "multiprocessing" package can be used to bypass the Global
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8336 * Interpreter Lock (GIL) and thus to improve performance and
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8337 * concurrency.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8338 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8339 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8340 * @return The authorization token, or NULL value in the case of an error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8341 * This string must be freed by OrthancPluginFreeString().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8342 * @ingroup Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8343 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8344 ORTHANC_PLUGIN_INLINE char* OrthancPluginGenerateRestApiAuthorizationToken(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8345 OrthancPluginContext* context)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8346 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8347 char* result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8348
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8349 _OrthancPluginRetrieveDynamicString params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8350 params.result = &result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8351 params.argument = NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8352
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8353 if (context->InvokeService(context, _OrthancPluginService_GenerateRestApiAuthorizationToken,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8354 &params) != OrthancPluginErrorCode_Success)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8355 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8356 /* Error */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8357 return NULL;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8358 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8359 else
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8360 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8361 return result;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8362 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8363 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8364
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8365
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8366
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8367 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8368 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8369 OrthancPluginMemoryBuffer64* target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8370 uint64_t size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8371 } _OrthancPluginCreateMemoryBuffer64;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8372
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8373 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8374 * @brief Create a 64-bit memory buffer.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8375 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8376 * This function creates a 64-bit memory buffer that is managed by
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8377 * the Orthanc core. The main use case of this function is for
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8378 * plugins that read files from the storage area.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8379 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8380 * Your plugin should never call "free()" on the resulting memory
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8381 * buffer, as the C library that is used by the plugin is in general
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8382 * not the same as the one used by the Orthanc core.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8383 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8384 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8385 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8386 * @param size Size of the memory buffer to be created.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8387 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8388 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8389 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8390 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCreateMemoryBuffer64(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8391 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8392 OrthancPluginMemoryBuffer64* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8393 uint64_t size)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8394 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8395 _OrthancPluginCreateMemoryBuffer64 params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8396 params.target = target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8397 params.size = size;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8398
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8399 return context->InvokeService(context, _OrthancPluginService_CreateMemoryBuffer64, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8400 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8401
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8402
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8403 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8404 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8405 OrthancPluginStorageCreate create;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8406 OrthancPluginStorageReadWhole readWhole;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8407 OrthancPluginStorageReadRange readRange;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8408 OrthancPluginStorageRemove remove;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8409 } _OrthancPluginRegisterStorageArea2;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8410
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8411 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8412 * @brief Register a custom storage area, with support for range request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8413 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8414 * This function registers a custom storage area, to replace the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8415 * built-in way Orthanc stores its files on the filesystem. This
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8416 * function must be called during the initialization of the plugin,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8417 * i.e. inside the OrthancPluginInitialize() public function.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8418 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8419 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8420 * @param create The callback function to store a file on the custom storage area.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8421 * @param readWhole The callback function to read a whole file from the custom storage area.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8422 * @param readRange The callback function to read some range of a file from the custom storage area.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8423 * If this feature is not supported by the plugin, this value can be set to NULL.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8424 * @param remove The callback function to remove a file from the custom storage area.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8425 * @ingroup Callbacks
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8426 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8427 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterStorageArea2(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8428 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8429 OrthancPluginStorageCreate create,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8430 OrthancPluginStorageReadWhole readWhole,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8431 OrthancPluginStorageReadRange readRange,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8432 OrthancPluginStorageRemove remove)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8433 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8434 _OrthancPluginRegisterStorageArea2 params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8435 params.create = create;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8436 params.readWhole = readWhole;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8437 params.readRange = readRange;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8438 params.remove = remove;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8439 context->InvokeService(context, _OrthancPluginService_RegisterStorageArea2, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8440 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8441
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8442
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8443
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8444 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8445 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8446 _OrthancPluginCreateDicom createDicom;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8447 const char* privateCreator;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8448 } _OrthancPluginCreateDicom2;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8449
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8450 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8451 * @brief Create a DICOM instance from a JSON string and an image, with a private creator.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8452 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8453 * This function takes as input a string containing a JSON file
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8454 * describing the content of a DICOM instance. As an output, it
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8455 * writes the corresponding DICOM instance to a newly allocated
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8456 * memory buffer. Additionally, an image to be encoded within the
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8457 * DICOM instance can also be provided.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8458 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8459 * Contrarily to the function OrthancPluginCreateDicom(), this
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8460 * function can be explicitly provided with a private creator.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8461 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8462 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8463 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8464 * @param json The input JSON file.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8465 * @param pixelData The image. Can be NULL, if the pixel data is encoded inside the JSON with the data URI scheme.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8466 * @param flags Flags governing the output.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8467 * @param privateCreator The private creator to be used for the private DICOM tags.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8468 * Check out the global configuration option "Dictionary" of Orthanc.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8469 * @return 0 if success, other value if error.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8470 * @ingroup Toolbox
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8471 * @see OrthancPluginCreateDicom
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8472 * @see OrthancPluginDicomBufferToJson
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8473 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8474 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCreateDicom2(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8475 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8476 OrthancPluginMemoryBuffer* target,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8477 const char* json,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8478 const OrthancPluginImage* pixelData,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8479 OrthancPluginCreateDicomFlags flags,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8480 const char* privateCreator)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8481 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8482 _OrthancPluginCreateDicom2 params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8483 params.createDicom.target = target;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8484 params.createDicom.json = json;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8485 params.createDicom.pixelData = pixelData;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8486 params.createDicom.flags = flags;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8487 params.privateCreator = privateCreator;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8488
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8489 return context->InvokeService(context, _OrthancPluginService_CreateDicom2, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8490 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8491
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8492
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8493
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8494
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8495
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8496
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8497 typedef struct
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8498 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8499 OrthancPluginMemoryBuffer* answerBody;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8500 OrthancPluginMemoryBuffer* answerHeaders;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8501 uint16_t* httpStatus;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8502 OrthancPluginHttpMethod method;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8503 const char* uri;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8504 uint32_t headersCount;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8505 const char* const* headersKeys;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8506 const char* const* headersValues;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8507 const void* body;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8508 uint32_t bodySize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8509 uint8_t afterPlugins;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8510 } _OrthancPluginCallRestApi;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8511
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8512 /**
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8513 * @brief Call the REST API of Orthanc with full flexibility.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8514 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8515 * Make a call to the given URI in the REST API of Orthanc. The
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8516 * result to the query is stored into a newly allocated memory
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8517 * buffer. This function is always granted full access to the REST
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8518 * API (no credentials, nor security token is needed).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8519 *
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8520 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8521 * @param answerBody The target memory buffer (out argument).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8522 * It must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8523 * The value of this argument is ignored if the HTTP method is DELETE.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8524 * @param answerHeaders The target memory buffer for the HTTP headers in the answer (out argument).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8525 * The answer headers are formatted as a JSON object (associative array).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8526 * The buffer must be freed with OrthancPluginFreeMemoryBuffer().
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8527 * This argument can be set to NULL if the plugin has no interest in the answer HTTP headers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8528 * @param httpStatus The HTTP status after the execution of the request (out argument).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8529 * @param method HTTP method to be used.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8530 * @param uri The URI of interest.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8531 * @param headersCount The number of HTTP headers.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8532 * @param headersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8533 * @param headersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8534 * @param body The HTTP body for a POST or PUT request.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8535 * @param bodySize The size of the body.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8536 * @param afterPlugins If 0, the built-in API of Orthanc is used.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8537 * If 1, the API is tainted by the plugins.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8538 * @return 0 if success, or the error code if failure.
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8539 * @see OrthancPluginRestApiGet2, OrthancPluginRestApiPost, OrthancPluginRestApiPut, OrthancPluginRestApiDelete
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8540 * @ingroup Orthanc
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8541 **/
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8542 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCallRestApi(
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8543 OrthancPluginContext* context,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8544 OrthancPluginMemoryBuffer* answerBody,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8545 OrthancPluginMemoryBuffer* answerHeaders,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8546 uint16_t* httpStatus,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8547 OrthancPluginHttpMethod method,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8548 const char* uri,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8549 uint32_t headersCount,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8550 const char* const* headersKeys,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8551 const char* const* headersValues,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8552 const void* body,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8553 uint32_t bodySize,
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8554 uint8_t afterPlugins)
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8555 {
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8556 _OrthancPluginCallRestApi params;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8557 memset(&params, 0, sizeof(params));
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8558
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8559 params.answerBody = answerBody;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8560 params.answerHeaders = answerHeaders;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8561 params.httpStatus = httpStatus;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8562 params.method = method;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8563 params.uri = uri;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8564 params.headersCount = headersCount;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8565 params.headersKeys = headersKeys;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8566 params.headersValues = headersValues;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8567 params.body = body;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8568 params.bodySize = bodySize;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8569 params.afterPlugins = afterPlugins;
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8570
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8571 return context->InvokeService(context, _OrthancPluginService_CallRestApi, &params);
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8572 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8573
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8574
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8575 #ifdef __cplusplus
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8576 }
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8577 #endif
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8578
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8579
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8580 /** @} */
c7dc70a0a477 upgrade to Orthanc SDK 1.9.2
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8581