annotate Resources/Orthanc/Sdk-1.12.3/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 bba27bbef7e0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
462
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * \mainpage
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * This C/C++ SDK allows external developers to create plugins that
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 * can be loaded into Orthanc to extend its functionality. Each
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 * Orthanc plugin must expose 4 public functions with the following
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * signatures:
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * -# <tt>int32_t OrthancPluginInitialize(const OrthancPluginContext* context)</tt>:
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * This function is invoked by Orthanc when it loads the plugin on startup.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * The plugin must:
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * - Check its compatibility with the Orthanc version using
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * ::OrthancPluginCheckVersion().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * - Store the context pointer so that it can use the plugin
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * services of Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * - Register all its REST callbacks using ::OrthancPluginRegisterRestCallback().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * - Possibly register its callback for received DICOM instances using ::OrthancPluginRegisterOnStoredInstanceCallback().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * - Possibly register its callback for changes to the DICOM store using ::OrthancPluginRegisterOnChangeCallback().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * - Possibly register a custom storage area using ::OrthancPluginRegisterStorageArea2().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * - Possibly register a custom database back-end area using OrthancPluginRegisterDatabaseBackendV4().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 * - Possibly register a handler for C-Find SCP using OrthancPluginRegisterFindCallback().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 * - Possibly register a handler for C-Find SCP against DICOM worklists using OrthancPluginRegisterWorklistCallback().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 * - Possibly register a handler for C-Move SCP using OrthancPluginRegisterMoveCallback().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 * - Possibly register a custom decoder for DICOM images using OrthancPluginRegisterDecodeImageCallback().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 * - Possibly register a callback to filter incoming HTTP requests using OrthancPluginRegisterIncomingHttpRequestFilter2().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 * - Possibly register a callback to unserialize jobs using OrthancPluginRegisterJobsUnserializer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 * - Possibly register a callback to refresh its metrics using OrthancPluginRegisterRefreshMetricsCallback().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 * - Possibly register a callback to answer chunked HTTP transfers using ::OrthancPluginRegisterChunkedRestCallback().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 * - Possibly register a callback for Storage Commitment SCP using ::OrthancPluginRegisterStorageCommitmentScpCallback().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 * - Possibly register a callback to keep/discard/modify incoming DICOM instances using OrthancPluginRegisterReceivedInstanceCallback().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 * - Possibly register a custom transcoder for DICOM images using OrthancPluginRegisterTranscoderCallback().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 * - Possibly register a callback to discard instances received through DICOM C-STORE using OrthancPluginRegisterIncomingCStoreInstanceFilter().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 * - Possibly register a callback to branch a WebDAV virtual filesystem using OrthancPluginRegisterWebDavCollection().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 * -# <tt>void OrthancPluginFinalize()</tt>:
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 * This function is invoked by Orthanc during its shutdown. The plugin
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 * must free all its memory.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 * -# <tt>const char* OrthancPluginGetName()</tt>:
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 * The plugin must return a short string to identify itself.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 * -# <tt>const char* OrthancPluginGetVersion()</tt>:
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 * The plugin must return a string containing its version number.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 * The name and the version of a plugin is only used to prevent it
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 * from being loaded twice. Note that, in C++, it is mandatory to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 * declare these functions within an <tt>extern "C"</tt> section.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 * To ensure multi-threading safety, the various REST callbacks are
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 * guaranteed to be executed in mutual exclusion since Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 * 0.8.5. If this feature is undesired (notably when developing
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 * high-performance plugins handling simultaneous requests), use
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 * ::OrthancPluginRegisterRestCallbackNoLock().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 * @defgroup Images Images and compression
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 * @brief Functions to deal with images and compressed buffers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 * @defgroup REST REST
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 * @brief Functions to answer REST requests in a callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 * @defgroup Callbacks Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 * @brief Functions to register and manage callbacks by the plugins.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 * @defgroup DicomCallbacks DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 * @brief Functions to register and manage DICOM callbacks (worklists, C-FIND, C-MOVE, storage commitment).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 * @defgroup Orthanc Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 * @brief Functions to access the content of the Orthanc server.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 * @defgroup DicomInstance DicomInstance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 * @brief Functions to access DICOM images that are managed by the Orthanc core.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 * @defgroup Toolbox Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 * @brief Generic functions to help with the creation of plugins.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 * Orthanc - A Lightweight, RESTful DICOM Store
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 * Department, University Hospital of Liege, Belgium
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 * Copyright (C) 2017-2024 Osimis S.A., Belgium
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 * This program is free software: you can redistribute it and/or
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 * modify it under the terms of the GNU General Public License as
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 * published by the Free Software Foundation, either version 3 of the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 * License, or (at your option) any later version.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 * This program is distributed in the hope that it will be useful, but
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 * WITHOUT ANY WARRANTY; without even the implied warranty of
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 * General Public License for more details.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 * You should have received a copy of the GNU General Public License
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 * along with this program. If not, see <http://www.gnu.org/licenses/>.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 #pragma once
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 #include <stdio.h>
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 #include <string.h>
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 #ifdef WIN32
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 # define ORTHANC_PLUGINS_API __declspec(dllexport)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 #elif __GNUC__ >= 4
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 # define ORTHANC_PLUGINS_API __attribute__ ((visibility ("default")))
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 #else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 # define ORTHANC_PLUGINS_API
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 #endif
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 #define ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER 1
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 #define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER 12
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 #define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 3
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 #if !defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 #define ORTHANC_PLUGINS_VERSION_IS_ABOVE(major, minor, revision) \
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER > major || \
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER == major && \
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER > minor || \
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER == minor && \
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER >= revision))))
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 #endif
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 /********************************************************************
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 ** Check that function inlining is properly supported. The use of
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 ** inlining is required, to avoid the duplication of object code
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 ** between two compilation modules that would use the Orthanc Plugin
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 ** API.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 ********************************************************************/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 /* If the auto-detection of the "inline" keyword below does not work
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 automatically and that your compiler is known to properly support
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 inlining, uncomment the following #define and adapt the definition
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 of "static inline". */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 /* #define ORTHANC_PLUGIN_INLINE static inline */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 #ifndef ORTHANC_PLUGIN_INLINE
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 # if __STDC_VERSION__ >= 199901L
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153 /* This is C99 or above: http://predef.sourceforge.net/prestd.html */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 # define ORTHANC_PLUGIN_INLINE static inline
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 # elif defined(__cplusplus)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 /* This is C++ */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 # define ORTHANC_PLUGIN_INLINE static inline
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 # elif defined(__GNUC__)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 /* This is GCC running in C89 mode */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 # define ORTHANC_PLUGIN_INLINE static __inline
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 # elif defined(_MSC_VER)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 /* This is Visual Studio running in C89 mode */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 # define ORTHANC_PLUGIN_INLINE static __inline
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 # else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 # error Your compiler is not known to support the "inline" keyword
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 # endif
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 #endif
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 /********************************************************************
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 ** Inclusion of standard libraries.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173 ********************************************************************/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 * For Microsoft Visual Studio, a compatibility "stdint.h" can be
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 * downloaded at the following URL:
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 * https://orthanc.uclouvain.be/hg/orthanc/raw-file/default/OrthancFramework/Resources/ThirdParty/VisualStudio/stdint.h
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180 #include <stdint.h>
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182 #include <stdlib.h>
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
185
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186 /********************************************************************
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 ** Definition of the Orthanc Plugin API.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188 ********************************************************************/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190 /** @{ */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 #ifdef __cplusplus
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 extern "C"
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195 #endif
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 * The various error codes that can be returned by the Orthanc core.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 typedef enum
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202 OrthancPluginErrorCode_InternalError = -1 /*!< Internal error */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 OrthancPluginErrorCode_Success = 0 /*!< Success */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 OrthancPluginErrorCode_Plugin = 1 /*!< Error encountered within the plugin engine */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205 OrthancPluginErrorCode_NotImplemented = 2 /*!< Not implemented yet */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206 OrthancPluginErrorCode_ParameterOutOfRange = 3 /*!< Parameter out of range */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207 OrthancPluginErrorCode_NotEnoughMemory = 4 /*!< The server hosting Orthanc is running out of memory */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208 OrthancPluginErrorCode_BadParameterType = 5 /*!< Bad type for a parameter */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209 OrthancPluginErrorCode_BadSequenceOfCalls = 6 /*!< Bad sequence of calls */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210 OrthancPluginErrorCode_InexistentItem = 7 /*!< Accessing an inexistent item */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211 OrthancPluginErrorCode_BadRequest = 8 /*!< Bad request */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212 OrthancPluginErrorCode_NetworkProtocol = 9 /*!< Error in the network protocol */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213 OrthancPluginErrorCode_SystemCommand = 10 /*!< Error while calling a system command */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214 OrthancPluginErrorCode_Database = 11 /*!< Error with the database engine */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215 OrthancPluginErrorCode_UriSyntax = 12 /*!< Badly formatted URI */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216 OrthancPluginErrorCode_InexistentFile = 13 /*!< Inexistent file */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 OrthancPluginErrorCode_CannotWriteFile = 14 /*!< Cannot write to file */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218 OrthancPluginErrorCode_BadFileFormat = 15 /*!< Bad file format */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219 OrthancPluginErrorCode_Timeout = 16 /*!< Timeout */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220 OrthancPluginErrorCode_UnknownResource = 17 /*!< Unknown resource */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 OrthancPluginErrorCode_IncompatibleDatabaseVersion = 18 /*!< Incompatible version of the database */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222 OrthancPluginErrorCode_FullStorage = 19 /*!< The file storage is full */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223 OrthancPluginErrorCode_CorruptedFile = 20 /*!< Corrupted file (e.g. inconsistent MD5 hash) */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224 OrthancPluginErrorCode_InexistentTag = 21 /*!< Inexistent tag */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225 OrthancPluginErrorCode_ReadOnly = 22 /*!< Cannot modify a read-only data structure */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226 OrthancPluginErrorCode_IncompatibleImageFormat = 23 /*!< Incompatible format of the images */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
227 OrthancPluginErrorCode_IncompatibleImageSize = 24 /*!< Incompatible size of the images */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 OrthancPluginErrorCode_SharedLibrary = 25 /*!< Error while using a shared library (plugin) */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229 OrthancPluginErrorCode_UnknownPluginService = 26 /*!< Plugin invoking an unknown service */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
230 OrthancPluginErrorCode_UnknownDicomTag = 27 /*!< Unknown DICOM tag */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
231 OrthancPluginErrorCode_BadJson = 28 /*!< Cannot parse a JSON document */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
232 OrthancPluginErrorCode_Unauthorized = 29 /*!< Bad credentials were provided to an HTTP request */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
233 OrthancPluginErrorCode_BadFont = 30 /*!< Badly formatted font file */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
234 OrthancPluginErrorCode_DatabasePlugin = 31 /*!< The plugin implementing a custom database back-end does not fulfill the proper interface */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
235 OrthancPluginErrorCode_StorageAreaPlugin = 32 /*!< Error in the plugin implementing a custom storage area */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
236 OrthancPluginErrorCode_EmptyRequest = 33 /*!< The request is empty */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
237 OrthancPluginErrorCode_NotAcceptable = 34 /*!< Cannot send a response which is acceptable according to the Accept HTTP header */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
238 OrthancPluginErrorCode_NullPointer = 35 /*!< Cannot handle a NULL pointer */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
239 OrthancPluginErrorCode_DatabaseUnavailable = 36 /*!< The database is currently not available (probably a transient situation) */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
240 OrthancPluginErrorCode_CanceledJob = 37 /*!< This job was canceled */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
241 OrthancPluginErrorCode_BadGeometry = 38 /*!< Geometry error encountered in Stone */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
242 OrthancPluginErrorCode_SslInitialization = 39 /*!< Cannot initialize SSL encryption, check out your certificates */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
243 OrthancPluginErrorCode_DiscontinuedAbi = 40 /*!< Calling a function that has been removed from the Orthanc Framework */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
244 OrthancPluginErrorCode_BadRange = 41 /*!< Incorrect range request */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
245 OrthancPluginErrorCode_DatabaseCannotSerialize = 42 /*!< Database could not serialize access due to concurrent update, the transaction should be retried */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
246 OrthancPluginErrorCode_Revision = 43 /*!< A bad revision number was provided, which might indicate conflict between multiple writers */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
247 OrthancPluginErrorCode_MainDicomTagsMultiplyDefined = 44 /*!< A main DICOM Tag has been defined multiple times for the same resource level */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
248 OrthancPluginErrorCode_ForbiddenAccess = 45 /*!< Access to a resource is forbidden */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
249 OrthancPluginErrorCode_DuplicateResource = 46 /*!< Duplicate resource */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
250 OrthancPluginErrorCode_SQLiteNotOpened = 1000 /*!< SQLite: The database is not opened */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
251 OrthancPluginErrorCode_SQLiteAlreadyOpened = 1001 /*!< SQLite: Connection is already open */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
252 OrthancPluginErrorCode_SQLiteCannotOpen = 1002 /*!< SQLite: Unable to open the database */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
253 OrthancPluginErrorCode_SQLiteStatementAlreadyUsed = 1003 /*!< SQLite: This cached statement is already being referred to */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
254 OrthancPluginErrorCode_SQLiteExecute = 1004 /*!< SQLite: Cannot execute a command */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
255 OrthancPluginErrorCode_SQLiteRollbackWithoutTransaction = 1005 /*!< SQLite: Rolling back a nonexistent transaction (have you called Begin()?) */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
256 OrthancPluginErrorCode_SQLiteCommitWithoutTransaction = 1006 /*!< SQLite: Committing a nonexistent transaction */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
257 OrthancPluginErrorCode_SQLiteRegisterFunction = 1007 /*!< SQLite: Unable to register a function */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
258 OrthancPluginErrorCode_SQLiteFlush = 1008 /*!< SQLite: Unable to flush the database */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
259 OrthancPluginErrorCode_SQLiteCannotRun = 1009 /*!< SQLite: Cannot run a cached statement */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
260 OrthancPluginErrorCode_SQLiteCannotStep = 1010 /*!< SQLite: Cannot step over a cached statement */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
261 OrthancPluginErrorCode_SQLiteBindOutOfRange = 1011 /*!< SQLite: Bing a value while out of range (serious error) */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
262 OrthancPluginErrorCode_SQLitePrepareStatement = 1012 /*!< SQLite: Cannot prepare a cached statement */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
263 OrthancPluginErrorCode_SQLiteTransactionAlreadyStarted = 1013 /*!< SQLite: Beginning the same transaction twice */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
264 OrthancPluginErrorCode_SQLiteTransactionCommit = 1014 /*!< SQLite: Failure when committing the transaction */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
265 OrthancPluginErrorCode_SQLiteTransactionBegin = 1015 /*!< SQLite: Cannot start a transaction */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
266 OrthancPluginErrorCode_DirectoryOverFile = 2000 /*!< The directory to be created is already occupied by a regular file */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
267 OrthancPluginErrorCode_FileStorageCannotWrite = 2001 /*!< Unable to create a subdirectory or a file in the file storage */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
268 OrthancPluginErrorCode_DirectoryExpected = 2002 /*!< The specified path does not point to a directory */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
269 OrthancPluginErrorCode_HttpPortInUse = 2003 /*!< The TCP port of the HTTP server is privileged or already in use */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
270 OrthancPluginErrorCode_DicomPortInUse = 2004 /*!< The TCP port of the DICOM server is privileged or already in use */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
271 OrthancPluginErrorCode_BadHttpStatusInRest = 2005 /*!< This HTTP status is not allowed in a REST API */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
272 OrthancPluginErrorCode_RegularFileExpected = 2006 /*!< The specified path does not point to a regular file */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
273 OrthancPluginErrorCode_PathToExecutable = 2007 /*!< Unable to get the path to the executable */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
274 OrthancPluginErrorCode_MakeDirectory = 2008 /*!< Cannot create a directory */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
275 OrthancPluginErrorCode_BadApplicationEntityTitle = 2009 /*!< An application entity title (AET) cannot be empty or be longer than 16 characters */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
276 OrthancPluginErrorCode_NoCFindHandler = 2010 /*!< No request handler factory for DICOM C-FIND SCP */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
277 OrthancPluginErrorCode_NoCMoveHandler = 2011 /*!< No request handler factory for DICOM C-MOVE SCP */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
278 OrthancPluginErrorCode_NoCStoreHandler = 2012 /*!< No request handler factory for DICOM C-STORE SCP */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
279 OrthancPluginErrorCode_NoApplicationEntityFilter = 2013 /*!< No application entity filter */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
280 OrthancPluginErrorCode_NoSopClassOrInstance = 2014 /*!< DicomUserConnection: Unable to find the SOP class and instance */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
281 OrthancPluginErrorCode_NoPresentationContext = 2015 /*!< DicomUserConnection: No acceptable presentation context for modality */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
282 OrthancPluginErrorCode_DicomFindUnavailable = 2016 /*!< DicomUserConnection: The C-FIND command is not supported by the remote SCP */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
283 OrthancPluginErrorCode_DicomMoveUnavailable = 2017 /*!< DicomUserConnection: The C-MOVE command is not supported by the remote SCP */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
284 OrthancPluginErrorCode_CannotStoreInstance = 2018 /*!< Cannot store an instance */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
285 OrthancPluginErrorCode_CreateDicomNotString = 2019 /*!< Only string values are supported when creating DICOM instances */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
286 OrthancPluginErrorCode_CreateDicomOverrideTag = 2020 /*!< Trying to override a value inherited from a parent module */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
287 OrthancPluginErrorCode_CreateDicomUseContent = 2021 /*!< Use \"Content\" to inject an image into a new DICOM instance */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
288 OrthancPluginErrorCode_CreateDicomNoPayload = 2022 /*!< No payload is present for one instance in the series */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
289 OrthancPluginErrorCode_CreateDicomUseDataUriScheme = 2023 /*!< The payload of the DICOM instance must be specified according to Data URI scheme */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
290 OrthancPluginErrorCode_CreateDicomBadParent = 2024 /*!< Trying to attach a new DICOM instance to an inexistent resource */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
291 OrthancPluginErrorCode_CreateDicomParentIsInstance = 2025 /*!< Trying to attach a new DICOM instance to an instance (must be a series, study or patient) */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
292 OrthancPluginErrorCode_CreateDicomParentEncoding = 2026 /*!< Unable to get the encoding of the parent resource */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
293 OrthancPluginErrorCode_UnknownModality = 2027 /*!< Unknown modality */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
294 OrthancPluginErrorCode_BadJobOrdering = 2028 /*!< Bad ordering of filters in a job */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
295 OrthancPluginErrorCode_JsonToLuaTable = 2029 /*!< Cannot convert the given JSON object to a Lua table */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
296 OrthancPluginErrorCode_CannotCreateLua = 2030 /*!< Cannot create the Lua context */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
297 OrthancPluginErrorCode_CannotExecuteLua = 2031 /*!< Cannot execute a Lua command */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
298 OrthancPluginErrorCode_LuaAlreadyExecuted = 2032 /*!< Arguments cannot be pushed after the Lua function is executed */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
299 OrthancPluginErrorCode_LuaBadOutput = 2033 /*!< The Lua function does not give the expected number of outputs */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
300 OrthancPluginErrorCode_NotLuaPredicate = 2034 /*!< The Lua function is not a predicate (only true/false outputs allowed) */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
301 OrthancPluginErrorCode_LuaReturnsNoString = 2035 /*!< The Lua function does not return a string */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
302 OrthancPluginErrorCode_StorageAreaAlreadyRegistered = 2036 /*!< Another plugin has already registered a custom storage area */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
303 OrthancPluginErrorCode_DatabaseBackendAlreadyRegistered = 2037 /*!< Another plugin has already registered a custom database back-end */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
304 OrthancPluginErrorCode_DatabaseNotInitialized = 2038 /*!< Plugin trying to call the database during its initialization */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
305 OrthancPluginErrorCode_SslDisabled = 2039 /*!< Orthanc has been built without SSL support */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
306 OrthancPluginErrorCode_CannotOrderSlices = 2040 /*!< Unable to order the slices of the series */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
307 OrthancPluginErrorCode_NoWorklistHandler = 2041 /*!< No request handler factory for DICOM C-Find Modality SCP */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
308 OrthancPluginErrorCode_AlreadyExistingTag = 2042 /*!< Cannot override the value of a tag that already exists */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
309 OrthancPluginErrorCode_NoStorageCommitmentHandler = 2043 /*!< No request handler factory for DICOM N-ACTION SCP (storage commitment) */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
310 OrthancPluginErrorCode_NoCGetHandler = 2044 /*!< No request handler factory for DICOM C-GET SCP */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
311 OrthancPluginErrorCode_UnsupportedMediaType = 3000 /*!< Unsupported media type */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
312
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
313 _OrthancPluginErrorCode_INTERNAL = 0x7fffffff
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
314 } OrthancPluginErrorCode;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
315
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
316
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
317 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
318 * Forward declaration of one of the mandatory functions for Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
319 * plugins.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
320 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
321 ORTHANC_PLUGINS_API const char* OrthancPluginGetName();
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
322
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
323
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
324 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
325 * The various HTTP methods for a REST call.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
326 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
327 typedef enum
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
328 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
329 OrthancPluginHttpMethod_Get = 1, /*!< GET request */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
330 OrthancPluginHttpMethod_Post = 2, /*!< POST request */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
331 OrthancPluginHttpMethod_Put = 3, /*!< PUT request */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
332 OrthancPluginHttpMethod_Delete = 4, /*!< DELETE request */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
333
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
334 _OrthancPluginHttpMethod_INTERNAL = 0x7fffffff
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
335 } OrthancPluginHttpMethod;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
336
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
337
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
338 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
339 * @brief The parameters of a REST request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
340 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
341 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
342 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
343 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
344 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
345 * @brief The HTTP method.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
346 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
347 OrthancPluginHttpMethod method;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
348
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
349 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
350 * @brief The number of groups of the regular expression.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
351 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
352 uint32_t groupsCount;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
353
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
354 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
355 * @brief The matched values for the groups of the regular expression.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
356 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
357 const char* const* groups;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
358
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
359 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
360 * @brief For a GET request, the number of GET parameters.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
361 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
362 uint32_t getCount;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
363
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
364 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
365 * @brief For a GET request, the keys of the GET parameters.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
366 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
367 const char* const* getKeys;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
368
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
369 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
370 * @brief For a GET request, the values of the GET parameters.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
371 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
372 const char* const* getValues;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
373
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
374 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
375 * @brief For a PUT or POST request, the content of the body.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
376 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
377 const void* body;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
378
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
379 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
380 * @brief For a PUT or POST request, the number of bytes of the body.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
381 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
382 uint32_t bodySize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
383
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
384
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
385 /* --------------------------------------------------
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
386 New in version 0.8.1
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
387 -------------------------------------------------- */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
388
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
389 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
390 * @brief The number of HTTP headers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
391 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
392 uint32_t headersCount;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
393
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
394 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
395 * @brief The keys of the HTTP headers (always converted to low-case).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
396 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
397 const char* const* headersKeys;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
398
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
399 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
400 * @brief The values of the HTTP headers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
401 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
402 const char* const* headersValues;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
403
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
404 } OrthancPluginHttpRequest;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
405
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
406
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
407 typedef enum
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
408 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
409 /* Generic services */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
410 _OrthancPluginService_LogInfo = 1,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
411 _OrthancPluginService_LogWarning = 2,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
412 _OrthancPluginService_LogError = 3,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
413 _OrthancPluginService_GetOrthancPath = 4,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
414 _OrthancPluginService_GetOrthancDirectory = 5,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
415 _OrthancPluginService_GetConfigurationPath = 6,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
416 _OrthancPluginService_SetPluginProperty = 7,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
417 _OrthancPluginService_GetGlobalProperty = 8,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
418 _OrthancPluginService_SetGlobalProperty = 9,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
419 _OrthancPluginService_GetCommandLineArgumentsCount = 10,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
420 _OrthancPluginService_GetCommandLineArgument = 11,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
421 _OrthancPluginService_GetExpectedDatabaseVersion = 12,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
422 _OrthancPluginService_GetConfiguration = 13,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
423 _OrthancPluginService_BufferCompression = 14,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
424 _OrthancPluginService_ReadFile = 15,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
425 _OrthancPluginService_WriteFile = 16,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
426 _OrthancPluginService_GetErrorDescription = 17,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
427 _OrthancPluginService_CallHttpClient = 18,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
428 _OrthancPluginService_RegisterErrorCode = 19,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
429 _OrthancPluginService_RegisterDictionaryTag = 20,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
430 _OrthancPluginService_DicomBufferToJson = 21,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
431 _OrthancPluginService_DicomInstanceToJson = 22,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
432 _OrthancPluginService_CreateDicom = 23,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
433 _OrthancPluginService_ComputeMd5 = 24,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
434 _OrthancPluginService_ComputeSha1 = 25,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
435 _OrthancPluginService_LookupDictionary = 26,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
436 _OrthancPluginService_CallHttpClient2 = 27,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
437 _OrthancPluginService_GenerateUuid = 28,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
438 _OrthancPluginService_RegisterPrivateDictionaryTag = 29,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
439 _OrthancPluginService_AutodetectMimeType = 30,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
440 _OrthancPluginService_SetMetricsValue = 31,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
441 _OrthancPluginService_EncodeDicomWebJson = 32,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
442 _OrthancPluginService_EncodeDicomWebXml = 33,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
443 _OrthancPluginService_ChunkedHttpClient = 34, /* New in Orthanc 1.5.7 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
444 _OrthancPluginService_GetTagName = 35, /* New in Orthanc 1.5.7 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
445 _OrthancPluginService_EncodeDicomWebJson2 = 36, /* New in Orthanc 1.7.0 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
446 _OrthancPluginService_EncodeDicomWebXml2 = 37, /* New in Orthanc 1.7.0 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
447 _OrthancPluginService_CreateMemoryBuffer = 38, /* New in Orthanc 1.7.0 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
448 _OrthancPluginService_GenerateRestApiAuthorizationToken = 39, /* New in Orthanc 1.8.1 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
449 _OrthancPluginService_CreateMemoryBuffer64 = 40, /* New in Orthanc 1.9.0 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
450 _OrthancPluginService_CreateDicom2 = 41, /* New in Orthanc 1.9.0 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
451 _OrthancPluginService_GetDatabaseServerIdentifier = 42, /* New in Orthanc 1.11.1 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
452 _OrthancPluginService_SetMetricsIntegerValue = 43, /* New in Orthanc 1.12.1 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
453 _OrthancPluginService_SetCurrentThreadName = 44, /* New in Orthanc 1.12.2 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
454
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
455
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
456 /* Registration of callbacks */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
457 _OrthancPluginService_RegisterRestCallback = 1000,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
458 _OrthancPluginService_RegisterOnStoredInstanceCallback = 1001,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
459 _OrthancPluginService_RegisterStorageArea = 1002,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
460 _OrthancPluginService_RegisterOnChangeCallback = 1003,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
461 _OrthancPluginService_RegisterRestCallbackNoLock = 1004,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
462 _OrthancPluginService_RegisterWorklistCallback = 1005,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
463 _OrthancPluginService_RegisterDecodeImageCallback = 1006,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
464 _OrthancPluginService_RegisterIncomingHttpRequestFilter = 1007,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
465 _OrthancPluginService_RegisterFindCallback = 1008,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
466 _OrthancPluginService_RegisterMoveCallback = 1009,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
467 _OrthancPluginService_RegisterIncomingHttpRequestFilter2 = 1010,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
468 _OrthancPluginService_RegisterRefreshMetricsCallback = 1011,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
469 _OrthancPluginService_RegisterChunkedRestCallback = 1012, /* New in Orthanc 1.5.7 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
470 _OrthancPluginService_RegisterStorageCommitmentScpCallback = 1013,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
471 _OrthancPluginService_RegisterIncomingDicomInstanceFilter = 1014,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
472 _OrthancPluginService_RegisterTranscoderCallback = 1015, /* New in Orthanc 1.7.0 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
473 _OrthancPluginService_RegisterStorageArea2 = 1016, /* New in Orthanc 1.9.0 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
474 _OrthancPluginService_RegisterIncomingCStoreInstanceFilter = 1017, /* New in Orthanc 1.10.0 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
475 _OrthancPluginService_RegisterReceivedInstanceCallback = 1018, /* New in Orthanc 1.10.0 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
476 _OrthancPluginService_RegisterWebDavCollection = 1019, /* New in Orthanc 1.10.1 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
477
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
478 /* Sending answers to REST calls */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
479 _OrthancPluginService_AnswerBuffer = 2000,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
480 _OrthancPluginService_CompressAndAnswerPngImage = 2001, /* Unused as of Orthanc 0.9.4 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
481 _OrthancPluginService_Redirect = 2002,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
482 _OrthancPluginService_SendHttpStatusCode = 2003,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
483 _OrthancPluginService_SendUnauthorized = 2004,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
484 _OrthancPluginService_SendMethodNotAllowed = 2005,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
485 _OrthancPluginService_SetCookie = 2006,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
486 _OrthancPluginService_SetHttpHeader = 2007,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
487 _OrthancPluginService_StartMultipartAnswer = 2008,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
488 _OrthancPluginService_SendMultipartItem = 2009,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
489 _OrthancPluginService_SendHttpStatus = 2010,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
490 _OrthancPluginService_CompressAndAnswerImage = 2011,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
491 _OrthancPluginService_SendMultipartItem2 = 2012,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
492 _OrthancPluginService_SetHttpErrorDetails = 2013,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
493
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
494 /* Access to the Orthanc database and API */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
495 _OrthancPluginService_GetDicomForInstance = 3000,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
496 _OrthancPluginService_RestApiGet = 3001,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
497 _OrthancPluginService_RestApiPost = 3002,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
498 _OrthancPluginService_RestApiDelete = 3003,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
499 _OrthancPluginService_RestApiPut = 3004,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
500 _OrthancPluginService_LookupPatient = 3005,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
501 _OrthancPluginService_LookupStudy = 3006,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
502 _OrthancPluginService_LookupSeries = 3007,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
503 _OrthancPluginService_LookupInstance = 3008,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
504 _OrthancPluginService_LookupStudyWithAccessionNumber = 3009,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
505 _OrthancPluginService_RestApiGetAfterPlugins = 3010,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
506 _OrthancPluginService_RestApiPostAfterPlugins = 3011,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
507 _OrthancPluginService_RestApiDeleteAfterPlugins = 3012,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
508 _OrthancPluginService_RestApiPutAfterPlugins = 3013,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
509 _OrthancPluginService_ReconstructMainDicomTags = 3014,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
510 _OrthancPluginService_RestApiGet2 = 3015,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
511 _OrthancPluginService_CallRestApi = 3016, /* New in Orthanc 1.9.2 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
512
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
513 /* Access to DICOM instances */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
514 _OrthancPluginService_GetInstanceRemoteAet = 4000,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
515 _OrthancPluginService_GetInstanceSize = 4001,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
516 _OrthancPluginService_GetInstanceData = 4002,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
517 _OrthancPluginService_GetInstanceJson = 4003,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
518 _OrthancPluginService_GetInstanceSimplifiedJson = 4004,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
519 _OrthancPluginService_HasInstanceMetadata = 4005,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
520 _OrthancPluginService_GetInstanceMetadata = 4006,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
521 _OrthancPluginService_GetInstanceOrigin = 4007,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
522 _OrthancPluginService_GetInstanceTransferSyntaxUid = 4008,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
523 _OrthancPluginService_HasInstancePixelData = 4009,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
524 _OrthancPluginService_CreateDicomInstance = 4010, /* New in Orthanc 1.7.0 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
525 _OrthancPluginService_FreeDicomInstance = 4011, /* New in Orthanc 1.7.0 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
526 _OrthancPluginService_GetInstanceFramesCount = 4012, /* New in Orthanc 1.7.0 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
527 _OrthancPluginService_GetInstanceRawFrame = 4013, /* New in Orthanc 1.7.0 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
528 _OrthancPluginService_GetInstanceDecodedFrame = 4014, /* New in Orthanc 1.7.0 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
529 _OrthancPluginService_TranscodeDicomInstance = 4015, /* New in Orthanc 1.7.0 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
530 _OrthancPluginService_SerializeDicomInstance = 4016, /* New in Orthanc 1.7.0 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
531 _OrthancPluginService_GetInstanceAdvancedJson = 4017, /* New in Orthanc 1.7.0 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
532 _OrthancPluginService_GetInstanceDicomWebJson = 4018, /* New in Orthanc 1.7.0 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
533 _OrthancPluginService_GetInstanceDicomWebXml = 4019, /* New in Orthanc 1.7.0 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
534 _OrthancPluginService_LoadDicomInstance = 4020, /* New in Orthanc 1.12.1 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
535
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
536 /* Services for plugins implementing a database back-end */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
537 _OrthancPluginService_RegisterDatabaseBackend = 5000, /* New in Orthanc 0.8.6 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
538 _OrthancPluginService_DatabaseAnswer = 5001,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
539 _OrthancPluginService_RegisterDatabaseBackendV2 = 5002, /* New in Orthanc 0.9.4 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
540 _OrthancPluginService_StorageAreaCreate = 5003,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
541 _OrthancPluginService_StorageAreaRead = 5004,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
542 _OrthancPluginService_StorageAreaRemove = 5005,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
543 _OrthancPluginService_RegisterDatabaseBackendV3 = 5006, /* New in Orthanc 1.9.2 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
544 _OrthancPluginService_RegisterDatabaseBackendV4 = 5007, /* New in Orthanc 1.12.0 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
545
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
546 /* Primitives for handling images */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
547 _OrthancPluginService_GetImagePixelFormat = 6000,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
548 _OrthancPluginService_GetImageWidth = 6001,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
549 _OrthancPluginService_GetImageHeight = 6002,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
550 _OrthancPluginService_GetImagePitch = 6003,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
551 _OrthancPluginService_GetImageBuffer = 6004,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
552 _OrthancPluginService_UncompressImage = 6005,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
553 _OrthancPluginService_FreeImage = 6006,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
554 _OrthancPluginService_CompressImage = 6007,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
555 _OrthancPluginService_ConvertPixelFormat = 6008,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
556 _OrthancPluginService_GetFontsCount = 6009,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
557 _OrthancPluginService_GetFontInfo = 6010,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
558 _OrthancPluginService_DrawText = 6011,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
559 _OrthancPluginService_CreateImage = 6012,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
560 _OrthancPluginService_CreateImageAccessor = 6013,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
561 _OrthancPluginService_DecodeDicomImage = 6014,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
562
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
563 /* Primitives for handling C-Find, C-Move and worklists */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
564 _OrthancPluginService_WorklistAddAnswer = 7000,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
565 _OrthancPluginService_WorklistMarkIncomplete = 7001,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
566 _OrthancPluginService_WorklistIsMatch = 7002,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
567 _OrthancPluginService_WorklistGetDicomQuery = 7003,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
568 _OrthancPluginService_FindAddAnswer = 7004,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
569 _OrthancPluginService_FindMarkIncomplete = 7005,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
570 _OrthancPluginService_GetFindQuerySize = 7006,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
571 _OrthancPluginService_GetFindQueryTag = 7007,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
572 _OrthancPluginService_GetFindQueryTagName = 7008,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
573 _OrthancPluginService_GetFindQueryValue = 7009,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
574 _OrthancPluginService_CreateFindMatcher = 7010,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
575 _OrthancPluginService_FreeFindMatcher = 7011,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
576 _OrthancPluginService_FindMatcherIsMatch = 7012,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
577
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
578 /* Primitives for accessing Orthanc Peers (new in 1.4.2) */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
579 _OrthancPluginService_GetPeers = 8000,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
580 _OrthancPluginService_FreePeers = 8001,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
581 _OrthancPluginService_GetPeersCount = 8003,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
582 _OrthancPluginService_GetPeerName = 8004,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
583 _OrthancPluginService_GetPeerUrl = 8005,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
584 _OrthancPluginService_CallPeerApi = 8006,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
585 _OrthancPluginService_GetPeerUserProperty = 8007,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
586
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
587 /* Primitives for handling jobs (new in 1.4.2) */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
588 _OrthancPluginService_CreateJob = 9000, /* Deprecated since SDK 1.11.3 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
589 _OrthancPluginService_FreeJob = 9001,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
590 _OrthancPluginService_SubmitJob = 9002,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
591 _OrthancPluginService_RegisterJobsUnserializer = 9003,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
592 _OrthancPluginService_CreateJob2 = 9004, /* New in SDK 1.11.3 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
593
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
594 _OrthancPluginService_INTERNAL = 0x7fffffff
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
595 } _OrthancPluginService;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
596
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
597
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
598 typedef enum
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
599 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
600 _OrthancPluginProperty_Description = 1,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
601 _OrthancPluginProperty_RootUri = 2,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
602 _OrthancPluginProperty_OrthancExplorer = 3,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
603
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
604 _OrthancPluginProperty_INTERNAL = 0x7fffffff
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
605 } _OrthancPluginProperty;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
606
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
607
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
608
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
609 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
610 * The memory layout of the pixels of an image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
611 * @ingroup Images
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
612 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
613 typedef enum
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
614 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
615 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
616 * @brief Graylevel 8bpp image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
617 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
618 * The image is graylevel. Each pixel is unsigned and stored in
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
619 * one byte.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
620 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
621 OrthancPluginPixelFormat_Grayscale8 = 1,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
622
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
623 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
624 * @brief Graylevel, unsigned 16bpp image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
625 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
626 * The image is graylevel. Each pixel is unsigned and stored in
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
627 * two bytes.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
628 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
629 OrthancPluginPixelFormat_Grayscale16 = 2,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
630
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
631 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
632 * @brief Graylevel, signed 16bpp image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
633 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
634 * The image is graylevel. Each pixel is signed and stored in two
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
635 * bytes.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
636 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
637 OrthancPluginPixelFormat_SignedGrayscale16 = 3,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
638
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
639 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
640 * @brief Color image in RGB24 format.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
641 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
642 * This format describes a color image. The pixels are stored in 3
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
643 * consecutive bytes. The memory layout is RGB.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
644 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
645 OrthancPluginPixelFormat_RGB24 = 4,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
646
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
647 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
648 * @brief Color image in RGBA32 format.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
649 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
650 * This format describes a color image. The pixels are stored in 4
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
651 * consecutive bytes. The memory layout is RGBA.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
652 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
653 OrthancPluginPixelFormat_RGBA32 = 5,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
654
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
655 OrthancPluginPixelFormat_Unknown = 6, /*!< Unknown pixel format */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
656
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
657 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
658 * @brief Color image in RGB48 format.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
659 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
660 * This format describes a color image. The pixels are stored in 6
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
661 * consecutive bytes. The memory layout is RRGGBB.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
662 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
663 OrthancPluginPixelFormat_RGB48 = 7,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
664
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
665 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
666 * @brief Graylevel, unsigned 32bpp image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
667 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
668 * The image is graylevel. Each pixel is unsigned and stored in
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
669 * four bytes.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
670 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
671 OrthancPluginPixelFormat_Grayscale32 = 8,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
672
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
673 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
674 * @brief Graylevel, floating-point 32bpp image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
675 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
676 * The image is graylevel. Each pixel is floating-point and stored
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
677 * in four bytes.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
678 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
679 OrthancPluginPixelFormat_Float32 = 9,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
680
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
681 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
682 * @brief Color image in BGRA32 format.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
683 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
684 * This format describes a color image. The pixels are stored in 4
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
685 * consecutive bytes. The memory layout is BGRA.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
686 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
687 OrthancPluginPixelFormat_BGRA32 = 10,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
688
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
689 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
690 * @brief Graylevel, unsigned 64bpp image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
691 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
692 * The image is graylevel. Each pixel is unsigned and stored in
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
693 * eight bytes.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
694 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
695 OrthancPluginPixelFormat_Grayscale64 = 11,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
696
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
697 _OrthancPluginPixelFormat_INTERNAL = 0x7fffffff
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
698 } OrthancPluginPixelFormat;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
699
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
700
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
701
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
702 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
703 * The content types that are supported by Orthanc plugins.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
704 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
705 typedef enum
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
706 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
707 OrthancPluginContentType_Unknown = 0, /*!< Unknown content type */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
708 OrthancPluginContentType_Dicom = 1, /*!< DICOM */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
709 OrthancPluginContentType_DicomAsJson = 2, /*!< JSON summary of a DICOM file */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
710 OrthancPluginContentType_DicomUntilPixelData = 3, /*!< DICOM Header till pixel data */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
711
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
712 _OrthancPluginContentType_INTERNAL = 0x7fffffff
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
713 } OrthancPluginContentType;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
714
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
715
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
716
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
717 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
718 * The supported types of DICOM resources.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
719 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
720 typedef enum
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
721 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
722 OrthancPluginResourceType_Patient = 0, /*!< Patient */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
723 OrthancPluginResourceType_Study = 1, /*!< Study */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
724 OrthancPluginResourceType_Series = 2, /*!< Series */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
725 OrthancPluginResourceType_Instance = 3, /*!< Instance */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
726 OrthancPluginResourceType_None = 4, /*!< Unavailable resource type */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
727
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
728 _OrthancPluginResourceType_INTERNAL = 0x7fffffff
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
729 } OrthancPluginResourceType;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
730
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
731
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
732
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
733 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
734 * The supported types of changes that can be signaled to the change callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
735 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
736 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
737 typedef enum
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
738 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
739 OrthancPluginChangeType_CompletedSeries = 0, /*!< Series is now complete */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
740 OrthancPluginChangeType_Deleted = 1, /*!< Deleted resource */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
741 OrthancPluginChangeType_NewChildInstance = 2, /*!< A new instance was added to this resource */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
742 OrthancPluginChangeType_NewInstance = 3, /*!< New instance received */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
743 OrthancPluginChangeType_NewPatient = 4, /*!< New patient created */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
744 OrthancPluginChangeType_NewSeries = 5, /*!< New series created */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
745 OrthancPluginChangeType_NewStudy = 6, /*!< New study created */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
746 OrthancPluginChangeType_StablePatient = 7, /*!< Timeout: No new instance in this patient */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
747 OrthancPluginChangeType_StableSeries = 8, /*!< Timeout: No new instance in this series */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
748 OrthancPluginChangeType_StableStudy = 9, /*!< Timeout: No new instance in this study */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
749 OrthancPluginChangeType_OrthancStarted = 10, /*!< Orthanc has started */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
750 OrthancPluginChangeType_OrthancStopped = 11, /*!< Orthanc is stopping */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
751 OrthancPluginChangeType_UpdatedAttachment = 12, /*!< Some user-defined attachment has changed for this resource */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
752 OrthancPluginChangeType_UpdatedMetadata = 13, /*!< Some user-defined metadata has changed for this resource */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
753 OrthancPluginChangeType_UpdatedPeers = 14, /*!< The list of Orthanc peers has changed */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
754 OrthancPluginChangeType_UpdatedModalities = 15, /*!< The list of DICOM modalities has changed */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
755 OrthancPluginChangeType_JobSubmitted = 16, /*!< New Job submitted */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
756 OrthancPluginChangeType_JobSuccess = 17, /*!< A Job has completed successfully */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
757 OrthancPluginChangeType_JobFailure = 18, /*!< A Job has failed */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
758
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
759 _OrthancPluginChangeType_INTERNAL = 0x7fffffff
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
760 } OrthancPluginChangeType;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
761
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
762
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
763 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
764 * The compression algorithms that are supported by the Orthanc core.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
765 * @ingroup Images
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
766 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
767 typedef enum
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
768 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
769 OrthancPluginCompressionType_Zlib = 0, /*!< Standard zlib compression */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
770 OrthancPluginCompressionType_ZlibWithSize = 1, /*!< zlib, prefixed with uncompressed size (uint64_t) */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
771 OrthancPluginCompressionType_Gzip = 2, /*!< Standard gzip compression */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
772 OrthancPluginCompressionType_GzipWithSize = 3, /*!< gzip, prefixed with uncompressed size (uint64_t) */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
773
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
774 _OrthancPluginCompressionType_INTERNAL = 0x7fffffff
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
775 } OrthancPluginCompressionType;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
776
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
777
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
778 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
779 * The image formats that are supported by the Orthanc core.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
780 * @ingroup Images
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
781 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
782 typedef enum
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
783 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
784 OrthancPluginImageFormat_Png = 0, /*!< Image compressed using PNG */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
785 OrthancPluginImageFormat_Jpeg = 1, /*!< Image compressed using JPEG */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
786 OrthancPluginImageFormat_Dicom = 2, /*!< Image compressed using DICOM */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
787
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
788 _OrthancPluginImageFormat_INTERNAL = 0x7fffffff
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
789 } OrthancPluginImageFormat;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
790
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
791
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
792 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
793 * The value representations present in the DICOM standard (version 2013).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
794 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
795 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
796 typedef enum
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
797 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
798 OrthancPluginValueRepresentation_AE = 1, /*!< Application Entity */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
799 OrthancPluginValueRepresentation_AS = 2, /*!< Age String */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
800 OrthancPluginValueRepresentation_AT = 3, /*!< Attribute Tag */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
801 OrthancPluginValueRepresentation_CS = 4, /*!< Code String */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
802 OrthancPluginValueRepresentation_DA = 5, /*!< Date */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
803 OrthancPluginValueRepresentation_DS = 6, /*!< Decimal String */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
804 OrthancPluginValueRepresentation_DT = 7, /*!< Date Time */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
805 OrthancPluginValueRepresentation_FD = 8, /*!< Floating Point Double */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
806 OrthancPluginValueRepresentation_FL = 9, /*!< Floating Point Single */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
807 OrthancPluginValueRepresentation_IS = 10, /*!< Integer String */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
808 OrthancPluginValueRepresentation_LO = 11, /*!< Long String */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
809 OrthancPluginValueRepresentation_LT = 12, /*!< Long Text */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
810 OrthancPluginValueRepresentation_OB = 13, /*!< Other Byte String */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
811 OrthancPluginValueRepresentation_OF = 14, /*!< Other Float String */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
812 OrthancPluginValueRepresentation_OW = 15, /*!< Other Word String */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
813 OrthancPluginValueRepresentation_PN = 16, /*!< Person Name */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
814 OrthancPluginValueRepresentation_SH = 17, /*!< Short String */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
815 OrthancPluginValueRepresentation_SL = 18, /*!< Signed Long */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
816 OrthancPluginValueRepresentation_SQ = 19, /*!< Sequence of Items */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
817 OrthancPluginValueRepresentation_SS = 20, /*!< Signed Short */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
818 OrthancPluginValueRepresentation_ST = 21, /*!< Short Text */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
819 OrthancPluginValueRepresentation_TM = 22, /*!< Time */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
820 OrthancPluginValueRepresentation_UI = 23, /*!< Unique Identifier (UID) */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
821 OrthancPluginValueRepresentation_UL = 24, /*!< Unsigned Long */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
822 OrthancPluginValueRepresentation_UN = 25, /*!< Unknown */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
823 OrthancPluginValueRepresentation_US = 26, /*!< Unsigned Short */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
824 OrthancPluginValueRepresentation_UT = 27, /*!< Unlimited Text */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
825
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
826 _OrthancPluginValueRepresentation_INTERNAL = 0x7fffffff
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
827 } OrthancPluginValueRepresentation;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
828
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
829
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
830 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
831 * The possible output formats for a DICOM-to-JSON conversion.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
832 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
833 * @see OrthancPluginDicomToJson()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
834 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
835 typedef enum
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
836 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
837 OrthancPluginDicomToJsonFormat_Full = 1, /*!< Full output, with most details */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
838 OrthancPluginDicomToJsonFormat_Short = 2, /*!< Tags output as hexadecimal numbers */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
839 OrthancPluginDicomToJsonFormat_Human = 3, /*!< Human-readable JSON */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
840
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
841 _OrthancPluginDicomToJsonFormat_INTERNAL = 0x7fffffff
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
842 } OrthancPluginDicomToJsonFormat;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
843
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
844
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
845 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
846 * Flags to customize a DICOM-to-JSON conversion. By default, binary
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
847 * tags are formatted using Data URI scheme.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
848 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
849 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
850 typedef enum
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
851 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
852 OrthancPluginDicomToJsonFlags_None = 0, /*!< Default formatting */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
853 OrthancPluginDicomToJsonFlags_IncludeBinary = (1 << 0), /*!< Include the binary tags */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
854 OrthancPluginDicomToJsonFlags_IncludePrivateTags = (1 << 1), /*!< Include the private tags */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
855 OrthancPluginDicomToJsonFlags_IncludeUnknownTags = (1 << 2), /*!< Include the tags unknown by the dictionary */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
856 OrthancPluginDicomToJsonFlags_IncludePixelData = (1 << 3), /*!< Include the pixel data */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
857 OrthancPluginDicomToJsonFlags_ConvertBinaryToAscii = (1 << 4), /*!< Output binary tags as-is, dropping non-ASCII */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
858 OrthancPluginDicomToJsonFlags_ConvertBinaryToNull = (1 << 5), /*!< Signal binary tags as null values */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
859 OrthancPluginDicomToJsonFlags_StopAfterPixelData = (1 << 6), /*!< Stop processing after pixel data (new in 1.9.1) */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
860 OrthancPluginDicomToJsonFlags_SkipGroupLengths = (1 << 7), /*!< Skip tags whose element is zero (new in 1.9.1) */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
861
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
862 _OrthancPluginDicomToJsonFlags_INTERNAL = 0x7fffffff
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
863 } OrthancPluginDicomToJsonFlags;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
864
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
865
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
866 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
867 * Flags for the creation of a DICOM file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
868 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
869 * @see OrthancPluginCreateDicom()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
870 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
871 typedef enum
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
872 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
873 OrthancPluginCreateDicomFlags_None = 0, /*!< Default mode */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
874 OrthancPluginCreateDicomFlags_DecodeDataUriScheme = (1 << 0), /*!< Decode fields encoded using data URI scheme */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
875 OrthancPluginCreateDicomFlags_GenerateIdentifiers = (1 << 1), /*!< Automatically generate DICOM identifiers */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
876
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
877 _OrthancPluginCreateDicomFlags_INTERNAL = 0x7fffffff
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
878 } OrthancPluginCreateDicomFlags;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
879
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
880
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
881 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
882 * The constraints on the DICOM identifiers that must be supported
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
883 * by the database plugins.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
884 * @deprecated Plugins using OrthancPluginConstraintType will be faster
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
885 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
886 typedef enum
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
887 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
888 OrthancPluginIdentifierConstraint_Equal = 1, /*!< Equal */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
889 OrthancPluginIdentifierConstraint_SmallerOrEqual = 2, /*!< Less or equal */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
890 OrthancPluginIdentifierConstraint_GreaterOrEqual = 3, /*!< More or equal */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
891 OrthancPluginIdentifierConstraint_Wildcard = 4, /*!< Case-sensitive wildcard matching (with * and ?) */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
892
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
893 _OrthancPluginIdentifierConstraint_INTERNAL = 0x7fffffff
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
894 } OrthancPluginIdentifierConstraint;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
895
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
896
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
897 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
898 * The constraints on the tags (main DICOM tags and identifier tags)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
899 * that must be supported by the database plugins.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
900 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
901 typedef enum
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
902 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
903 OrthancPluginConstraintType_Equal = 1, /*!< Equal */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
904 OrthancPluginConstraintType_SmallerOrEqual = 2, /*!< Less or equal */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
905 OrthancPluginConstraintType_GreaterOrEqual = 3, /*!< More or equal */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
906 OrthancPluginConstraintType_Wildcard = 4, /*!< Wildcard matching */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
907 OrthancPluginConstraintType_List = 5, /*!< List of values */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
908
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
909 _OrthancPluginConstraintType_INTERNAL = 0x7fffffff
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
910 } OrthancPluginConstraintType;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
911
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
912
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
913 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
914 * The origin of a DICOM instance that has been received by Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
915 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
916 typedef enum
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
917 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
918 OrthancPluginInstanceOrigin_Unknown = 1, /*!< Unknown origin */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
919 OrthancPluginInstanceOrigin_DicomProtocol = 2, /*!< Instance received through DICOM protocol */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
920 OrthancPluginInstanceOrigin_RestApi = 3, /*!< Instance received through REST API of Orthanc */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
921 OrthancPluginInstanceOrigin_Plugin = 4, /*!< Instance added to Orthanc by a plugin */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
922 OrthancPluginInstanceOrigin_Lua = 5, /*!< Instance added to Orthanc by a Lua script */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
923 OrthancPluginInstanceOrigin_WebDav = 6, /*!< Instance received through WebDAV (new in 1.8.0) */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
924
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
925 _OrthancPluginInstanceOrigin_INTERNAL = 0x7fffffff
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
926 } OrthancPluginInstanceOrigin;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
927
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
928
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
929 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
930 * The possible status for one single step of a job.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
931 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
932 typedef enum
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
933 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
934 OrthancPluginJobStepStatus_Success = 1, /*!< The job has successfully executed all its steps */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
935 OrthancPluginJobStepStatus_Failure = 2, /*!< The job has failed while executing this step */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
936 OrthancPluginJobStepStatus_Continue = 3 /*!< The job has still data to process after this step */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
937 } OrthancPluginJobStepStatus;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
938
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
939
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
940 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
941 * Explains why the job should stop and release the resources it has
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
942 * allocated. This is especially important to disambiguate between
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
943 * the "paused" condition and the "final" conditions (success,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
944 * failure, or canceled).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
945 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
946 typedef enum
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
947 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
948 OrthancPluginJobStopReason_Success = 1, /*!< The job has succeeded */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
949 OrthancPluginJobStopReason_Paused = 2, /*!< The job was paused, and will be resumed later */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
950 OrthancPluginJobStopReason_Failure = 3, /*!< The job has failed, and might be resubmitted later */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
951 OrthancPluginJobStopReason_Canceled = 4 /*!< The job was canceled, and might be resubmitted later */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
952 } OrthancPluginJobStopReason;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
953
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
954
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
955 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
956 * The available types of metrics.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
957 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
958 typedef enum
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
959 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
960 OrthancPluginMetricsType_Default = 0, /*!< Default metrics */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
961
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
962 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
963 * This metrics represents a time duration. Orthanc will keep the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
964 * maximum value of the metrics over a sliding window of ten
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
965 * seconds, which is useful if the metrics is sampled frequently.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
966 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
967 OrthancPluginMetricsType_Timer = 1
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
968 } OrthancPluginMetricsType;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
969
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
970
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
971 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
972 * The available modes to export a binary DICOM tag into a DICOMweb
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
973 * JSON or XML document.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
974 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
975 typedef enum
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
976 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
977 OrthancPluginDicomWebBinaryMode_Ignore = 0, /*!< Don't include binary tags */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
978 OrthancPluginDicomWebBinaryMode_InlineBinary = 1, /*!< Inline encoding using Base64 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
979 OrthancPluginDicomWebBinaryMode_BulkDataUri = 2 /*!< Use a bulk data URI field */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
980 } OrthancPluginDicomWebBinaryMode;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
981
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
982
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
983 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
984 * The available values for the Failure Reason (0008,1197) during
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
985 * storage commitment.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
986 * http://dicom.nema.org/medical/dicom/2019e/output/chtml/part03/sect_C.14.html#sect_C.14.1.1
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
987 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
988 typedef enum
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
989 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
990 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
991 * Success: The DICOM instance is properly stored in the SCP
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
992 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
993 OrthancPluginStorageCommitmentFailureReason_Success = 0,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
994
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
995 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
996 * 0110H: A general failure in processing the operation was encountered
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
997 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
998 OrthancPluginStorageCommitmentFailureReason_ProcessingFailure = 1,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
999
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1000 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1001 * 0112H: One or more of the elements in the Referenced SOP
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1002 * Instance Sequence was not available
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1003 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1004 OrthancPluginStorageCommitmentFailureReason_NoSuchObjectInstance = 2,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1005
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1006 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1007 * 0213H: The SCP does not currently have enough resources to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1008 * store the requested SOP Instance(s)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1009 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1010 OrthancPluginStorageCommitmentFailureReason_ResourceLimitation = 3,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1011
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1012 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1013 * 0122H: Storage Commitment has been requested for a SOP Instance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1014 * with a SOP Class that is not supported by the SCP
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1015 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1016 OrthancPluginStorageCommitmentFailureReason_ReferencedSOPClassNotSupported = 4,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1017
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1018 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1019 * 0119H: The SOP Class of an element in the Referenced SOP
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1020 * Instance Sequence did not correspond to the SOP class
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1021 * registered for this SOP Instance at the SCP
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1022 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1023 OrthancPluginStorageCommitmentFailureReason_ClassInstanceConflict = 5,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1024
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1025 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1026 * 0131H: The Transaction UID of the Storage Commitment Request is
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1027 * already in use
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1028 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1029 OrthancPluginStorageCommitmentFailureReason_DuplicateTransactionUID = 6
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1030 } OrthancPluginStorageCommitmentFailureReason;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1031
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1032
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1033 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1034 * The action to be taken after ReceivedInstanceCallback is triggered
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1035 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1036 typedef enum
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1037 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1038 OrthancPluginReceivedInstanceAction_KeepAsIs = 1, /*!< Keep the instance as is */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1039 OrthancPluginReceivedInstanceAction_Modify = 2, /*!< Modify the instance */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1040 OrthancPluginReceivedInstanceAction_Discard = 3, /*!< Discard the instance */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1041
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1042 _OrthancPluginReceivedInstanceAction_INTERNAL = 0x7fffffff
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1043 } OrthancPluginReceivedInstanceAction;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1044
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1045
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1046 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1047 * Mode specifying how to load a DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1048 * @see OrthancPluginLoadDicomInstance()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1049 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1050 typedef enum
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1051 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1052 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1053 * Load the whole DICOM file, including pixel data
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1054 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1055 OrthancPluginLoadDicomInstanceMode_WholeDicom = 1,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1056
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1057 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1058 * Load the whole DICOM file until pixel data, which speeds up the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1059 * loading
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1060 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1061 OrthancPluginLoadDicomInstanceMode_UntilPixelData = 2,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1062
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1063 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1064 * Load the whole DICOM file until pixel data, and replace pixel
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1065 * data by an empty tag whose VR (value representation) is the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1066 * same as those of the original DICOM file
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1067 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1068 OrthancPluginLoadDicomInstanceMode_EmptyPixelData = 3,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1069
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1070 _OrthancPluginLoadDicomInstanceMode_INTERNAL = 0x7fffffff
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1071 } OrthancPluginLoadDicomInstanceMode;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1072
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1073
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1074 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1075 * @brief A 32-bit memory buffer allocated by the core system of Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1076 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1077 * A memory buffer allocated by the core system of Orthanc. When the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1078 * content of the buffer is not useful anymore, it must be free by a
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1079 * call to ::OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1080 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1081 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1082 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1083 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1084 * @brief The content of the buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1085 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1086 void* data;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1087
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1088 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1089 * @brief The number of bytes in the buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1090 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1091 uint32_t size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1092 } OrthancPluginMemoryBuffer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1093
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1094
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1095
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1096 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1097 * @brief A 64-bit memory buffer allocated by the core system of Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1098 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1099 * A memory buffer allocated by the core system of Orthanc. When the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1100 * content of the buffer is not useful anymore, it must be free by a
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1101 * call to ::OrthancPluginFreeMemoryBuffer64().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1102 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1103 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1104 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1105 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1106 * @brief The content of the buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1107 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1108 void* data;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1109
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1110 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1111 * @brief The number of bytes in the buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1112 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1113 uint64_t size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1114 } OrthancPluginMemoryBuffer64;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1115
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1116
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1117
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1118
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1119 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1120 * @brief Opaque structure that represents the HTTP connection to the client application.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1121 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1122 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1123 typedef struct _OrthancPluginRestOutput_t OrthancPluginRestOutput;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1124
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1125
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1126
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1127 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1128 * @brief Opaque structure that represents a DICOM instance that is managed by the Orthanc core.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1129 * @ingroup DicomInstance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1130 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1131 typedef struct _OrthancPluginDicomInstance_t OrthancPluginDicomInstance;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1132
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1133
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1134
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1135 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1136 * @brief Opaque structure that represents an image that is uncompressed in memory.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1137 * @ingroup Images
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1138 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1139 typedef struct _OrthancPluginImage_t OrthancPluginImage;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1140
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1141
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1142
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1143 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1144 * @brief Opaque structure that represents the storage area that is actually used by Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1145 * @ingroup Images
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1146 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1147 typedef struct _OrthancPluginStorageArea_t OrthancPluginStorageArea;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1148
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1149
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1150
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1151 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1152 * @brief Opaque structure to an object that represents a C-Find query for worklists.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1153 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1154 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1155 typedef struct _OrthancPluginWorklistQuery_t OrthancPluginWorklistQuery;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1156
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1157
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1158
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1159 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1160 * @brief Opaque structure to an object that represents the answers to a C-Find query for worklists.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1161 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1162 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1163 typedef struct _OrthancPluginWorklistAnswers_t OrthancPluginWorklistAnswers;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1164
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1165
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1166
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1167 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1168 * @brief Opaque structure to an object that represents a C-Find query.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1169 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1170 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1171 typedef struct _OrthancPluginFindQuery_t OrthancPluginFindQuery;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1172
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1173
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1174
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1175 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1176 * @brief Opaque structure to an object that represents the answers to a C-Find query for worklists.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1177 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1178 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1179 typedef struct _OrthancPluginFindAnswers_t OrthancPluginFindAnswers;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1180
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1181
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1182
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1183 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1184 * @brief Opaque structure to an object that can be used to check whether a DICOM instance matches a C-Find query.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1185 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1186 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1187 typedef struct _OrthancPluginFindMatcher_t OrthancPluginFindMatcher;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1188
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1189
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1190
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1191 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1192 * @brief Opaque structure to the set of remote Orthanc Peers that are known to the local Orthanc server.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1193 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1194 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1195 typedef struct _OrthancPluginPeers_t OrthancPluginPeers;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1196
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1197
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1198
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1199 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1200 * @brief Opaque structure to a job to be executed by Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1201 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1202 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1203 typedef struct _OrthancPluginJob_t OrthancPluginJob;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1204
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1205
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1206
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1207 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1208 * @brief Opaque structure that represents a node in a JSON or XML
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1209 * document used in DICOMweb.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1210 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1211 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1212 typedef struct _OrthancPluginDicomWebNode_t OrthancPluginDicomWebNode;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1213
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1214
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1215
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1216 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1217 * @brief Signature of a callback function that answers to a REST request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1218 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1219 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1220 typedef OrthancPluginErrorCode (*OrthancPluginRestCallback) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1221 OrthancPluginRestOutput* output,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1222 const char* url,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1223 const OrthancPluginHttpRequest* request);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1224
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1225
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1226
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1227 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1228 * @brief Signature of a callback function that is triggered when Orthanc stores a new DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1229 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1230 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1231 typedef OrthancPluginErrorCode (*OrthancPluginOnStoredInstanceCallback) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1232 const OrthancPluginDicomInstance* instance,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1233 const char* instanceId);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1234
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1235
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1236
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1237 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1238 * @brief Signature of a callback function that is triggered when a change happens to some DICOM resource.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1239 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1240 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1241 typedef OrthancPluginErrorCode (*OrthancPluginOnChangeCallback) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1242 OrthancPluginChangeType changeType,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1243 OrthancPluginResourceType resourceType,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1244 const char* resourceId);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1245
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1246
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1247
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1248 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1249 * @brief Signature of a callback function to decode a DICOM instance as an image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1250 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1251 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1252 typedef OrthancPluginErrorCode (*OrthancPluginDecodeImageCallback) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1253 OrthancPluginImage** target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1254 const void* dicom,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1255 const uint32_t size,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1256 uint32_t frameIndex);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1257
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1258
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1259
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1260 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1261 * @brief Signature of a function to free dynamic memory.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1262 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1263 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1264 typedef void (*OrthancPluginFree) (void* buffer);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1265
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1266
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1267
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1268 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1269 * @brief Signature of a function to set the content of a node
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1270 * encoding a binary DICOM tag, into a JSON or XML document
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1271 * generated for DICOMweb.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1272 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1273 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1274 typedef void (*OrthancPluginDicomWebSetBinaryNode) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1275 OrthancPluginDicomWebNode* node,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1276 OrthancPluginDicomWebBinaryMode mode,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1277 const char* bulkDataUri);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1278
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1279
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1280
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1281 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1282 * @brief Callback for writing to the storage area.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1283 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1284 * Signature of a callback function that is triggered when Orthanc writes a file to the storage area.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1285 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1286 * @param uuid The UUID of the file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1287 * @param content The content of the file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1288 * @param size The size of the file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1289 * @param type The content type corresponding to this file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1290 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1291 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1292 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1293 typedef OrthancPluginErrorCode (*OrthancPluginStorageCreate) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1294 const char* uuid,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1295 const void* content,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1296 int64_t size,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1297 OrthancPluginContentType type);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1298
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1299
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1300
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1301 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1302 * @brief Callback for reading from the storage area.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1303 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1304 * Signature of a callback function that is triggered when Orthanc reads a file from the storage area.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1305 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1306 * @param content The content of the file (output).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1307 * @param size The size of the file (output).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1308 * @param uuid The UUID of the file of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1309 * @param type The content type corresponding to this file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1310 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1311 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1312 * @deprecated New plugins should use OrthancPluginStorageRead2
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1313 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1314 * @warning The "content" buffer *must* have been allocated using
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1315 * the "malloc()" function of your C standard library (i.e. nor
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1316 * "new[]", neither a pointer to a buffer). The "free()" function of
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1317 * your C standard library will automatically be invoked on the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1318 * "content" pointer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1319 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1320 typedef OrthancPluginErrorCode (*OrthancPluginStorageRead) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1321 void** content,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1322 int64_t* size,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1323 const char* uuid,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1324 OrthancPluginContentType type);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1325
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1326
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1327
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1328 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1329 * @brief Callback for reading a whole file from the storage area.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1330 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1331 * Signature of a callback function that is triggered when Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1332 * reads a whole file from the storage area.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1333 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1334 * @param target Memory buffer where to store the content of the file. It must be allocated by the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1335 * plugin using OrthancPluginCreateMemoryBuffer64(). The core of Orthanc will free it.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1336 * @param uuid The UUID of the file of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1337 * @param type The content type corresponding to this file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1338 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1339 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1340 typedef OrthancPluginErrorCode (*OrthancPluginStorageReadWhole) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1341 OrthancPluginMemoryBuffer64* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1342 const char* uuid,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1343 OrthancPluginContentType type);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1344
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1345
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1346
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1347 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1348 * @brief Callback for reading a range of a file from the storage area.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1349 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1350 * Signature of a callback function that is triggered when Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1351 * reads a portion of a file from the storage area. Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1352 * indicates the start position and the length of the range.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1353 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1354 * @param target Memory buffer where to store the content of the range.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1355 * The memory buffer is allocated and freed by Orthanc. The length of the range
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1356 * of interest corresponds to the size of this buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1357 * @param uuid The UUID of the file of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1358 * @param type The content type corresponding to this file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1359 * @param rangeStart Start position of the requested range in the file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1360 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1361 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1362 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1363 typedef OrthancPluginErrorCode (*OrthancPluginStorageReadRange) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1364 OrthancPluginMemoryBuffer64* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1365 const char* uuid,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1366 OrthancPluginContentType type,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1367 uint64_t rangeStart);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1368
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1369
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1370
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1371 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1372 * @brief Callback for removing a file from the storage area.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1373 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1374 * Signature of a callback function that is triggered when Orthanc deletes a file from the storage area.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1375 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1376 * @param uuid The UUID of the file to be removed.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1377 * @param type The content type corresponding to this file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1378 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1379 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1380 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1381 typedef OrthancPluginErrorCode (*OrthancPluginStorageRemove) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1382 const char* uuid,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1383 OrthancPluginContentType type);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1384
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1385
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1386
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1387 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1388 * @brief Callback to handle the C-Find SCP requests for worklists.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1389 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1390 * Signature of a callback function that is triggered when Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1391 * receives a C-Find SCP request against modality worklists.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1392 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1393 * @param answers The target structure where answers must be stored.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1394 * @param query The worklist query.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1395 * @param issuerAet The Application Entity Title (AET) of the modality from which the request originates.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1396 * @param calledAet The Application Entity Title (AET) of the modality that is called by the request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1397 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1398 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1399 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1400 typedef OrthancPluginErrorCode (*OrthancPluginWorklistCallback) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1401 OrthancPluginWorklistAnswers* answers,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1402 const OrthancPluginWorklistQuery* query,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1403 const char* issuerAet,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1404 const char* calledAet);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1405
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1406
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1407
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1408 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1409 * @brief Callback to filter incoming HTTP requests received by Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1410 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1411 * Signature of a callback function that is triggered whenever
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1412 * Orthanc receives an HTTP/REST request, and that answers whether
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1413 * this request should be allowed. If the callback returns "0"
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1414 * ("false"), the server answers with HTTP status code 403
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1415 * (Forbidden).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1416 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1417 * Pay attention to the fact that this function may be invoked
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1418 * concurrently by different threads of the Web server of
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1419 * Orthanc. You must implement proper locking if applicable.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1420 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1421 * @param method The HTTP method used by the request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1422 * @param uri The URI of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1423 * @param ip The IP address of the HTTP client.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1424 * @param headersCount The number of HTTP headers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1425 * @param headersKeys The keys of the HTTP headers (always converted to low-case).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1426 * @param headersValues The values of the HTTP headers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1427 * @return 0 if forbidden access, 1 if allowed access, -1 if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1428 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1429 * @deprecated Please instead use OrthancPluginIncomingHttpRequestFilter2()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1430 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1431 typedef int32_t (*OrthancPluginIncomingHttpRequestFilter) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1432 OrthancPluginHttpMethod method,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1433 const char* uri,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1434 const char* ip,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1435 uint32_t headersCount,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1436 const char* const* headersKeys,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1437 const char* const* headersValues);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1438
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1439
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1440
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1441 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1442 * @brief Callback to filter incoming HTTP requests received by Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1443 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1444 * Signature of a callback function that is triggered whenever
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1445 * Orthanc receives an HTTP/REST request, and that answers whether
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1446 * this request should be allowed. If the callback returns "0"
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1447 * ("false"), the server answers with HTTP status code 403
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1448 * (Forbidden).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1449 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1450 * Pay attention to the fact that this function may be invoked
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1451 * concurrently by different threads of the Web server of
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1452 * Orthanc. You must implement proper locking if applicable.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1453 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1454 * @param method The HTTP method used by the request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1455 * @param uri The URI of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1456 * @param ip The IP address of the HTTP client.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1457 * @param headersCount The number of HTTP headers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1458 * @param headersKeys The keys of the HTTP headers (always converted to low-case).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1459 * @param headersValues The values of the HTTP headers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1460 * @param getArgumentsCount The number of GET arguments (only for the GET HTTP method).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1461 * @param getArgumentsKeys The keys of the GET arguments (only for the GET HTTP method).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1462 * @param getArgumentsValues The values of the GET arguments (only for the GET HTTP method).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1463 * @return 0 if forbidden access, 1 if allowed access, -1 if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1464 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1465 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1466 typedef int32_t (*OrthancPluginIncomingHttpRequestFilter2) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1467 OrthancPluginHttpMethod method,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1468 const char* uri,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1469 const char* ip,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1470 uint32_t headersCount,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1471 const char* const* headersKeys,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1472 const char* const* headersValues,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1473 uint32_t getArgumentsCount,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1474 const char* const* getArgumentsKeys,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1475 const char* const* getArgumentsValues);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1476
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1477
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1478
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1479 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1480 * @brief Callback to handle incoming C-Find SCP requests.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1481 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1482 * Signature of a callback function that is triggered whenever
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1483 * Orthanc receives a C-Find SCP request not concerning modality
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1484 * worklists.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1485 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1486 * @param answers The target structure where answers must be stored.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1487 * @param query The worklist query.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1488 * @param issuerAet The Application Entity Title (AET) of the modality from which the request originates.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1489 * @param calledAet The Application Entity Title (AET) of the modality that is called by the request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1490 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1491 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1492 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1493 typedef OrthancPluginErrorCode (*OrthancPluginFindCallback) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1494 OrthancPluginFindAnswers* answers,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1495 const OrthancPluginFindQuery* query,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1496 const char* issuerAet,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1497 const char* calledAet);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1498
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1499
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1500
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1501 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1502 * @brief Callback to handle incoming C-Move SCP requests.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1503 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1504 * Signature of a callback function that is triggered whenever
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1505 * Orthanc receives a C-Move SCP request. The callback receives the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1506 * type of the resource of interest (study, series, instance...)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1507 * together with the DICOM tags containing its identifiers. In turn,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1508 * the plugin must create a driver object that will be responsible
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1509 * for driving the successive move suboperations.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1510 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1511 * @param resourceType The type of the resource of interest. Note
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1512 * that this might be set to ResourceType_None if the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1513 * QueryRetrieveLevel (0008,0052) tag was not provided by the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1514 * issuer (i.e. the originator modality).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1515 * @param patientId Content of the PatientID (0x0010, 0x0020) tag of the resource of interest. Might be NULL.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1516 * @param accessionNumber Content of the AccessionNumber (0x0008, 0x0050) tag. Might be NULL.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1517 * @param studyInstanceUid Content of the StudyInstanceUID (0x0020, 0x000d) tag. Might be NULL.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1518 * @param seriesInstanceUid Content of the SeriesInstanceUID (0x0020, 0x000e) tag. Might be NULL.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1519 * @param sopInstanceUid Content of the SOPInstanceUID (0x0008, 0x0018) tag. Might be NULL.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1520 * @param originatorAet The Application Entity Title (AET) of the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1521 * modality from which the request originates.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1522 * @param sourceAet The Application Entity Title (AET) of the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1523 * modality that should send its DICOM files to another modality.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1524 * @param targetAet The Application Entity Title (AET) of the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1525 * modality that should receive the DICOM files.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1526 * @param originatorId The Message ID issued by the originator modality,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1527 * as found in tag (0000,0110) of the DICOM query emitted by the issuer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1528 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1529 * @return The NULL value if the plugin cannot deal with this query,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1530 * or a pointer to the driver object that is responsible for
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1531 * handling the successive move suboperations.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1532 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1533 * @note If targetAet equals sourceAet, this is actually a query/retrieve operation.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1534 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1535 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1536 typedef void* (*OrthancPluginMoveCallback) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1537 OrthancPluginResourceType resourceType,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1538 const char* patientId,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1539 const char* accessionNumber,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1540 const char* studyInstanceUid,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1541 const char* seriesInstanceUid,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1542 const char* sopInstanceUid,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1543 const char* originatorAet,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1544 const char* sourceAet,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1545 const char* targetAet,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1546 uint16_t originatorId);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1547
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1548
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1549 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1550 * @brief Callback to read the size of a C-Move driver.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1551 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1552 * Signature of a callback function that returns the number of
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1553 * C-Move suboperations that are to be achieved by the given C-Move
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1554 * driver. This driver is the return value of a previous call to the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1555 * OrthancPluginMoveCallback() callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1556 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1557 * @param moveDriver The C-Move driver of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1558 * @return The number of suboperations.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1559 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1560 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1561 typedef uint32_t (*OrthancPluginGetMoveSize) (void* moveDriver);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1562
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1563
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1564 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1565 * @brief Callback to apply one C-Move suboperation.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1566 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1567 * Signature of a callback function that applies the next C-Move
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1568 * suboperation that os to be achieved by the given C-Move
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1569 * driver. This driver is the return value of a previous call to the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1570 * OrthancPluginMoveCallback() callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1571 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1572 * @param moveDriver The C-Move driver of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1573 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1574 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1575 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1576 typedef OrthancPluginErrorCode (*OrthancPluginApplyMove) (void* moveDriver);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1577
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1578
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1579 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1580 * @brief Callback to free one C-Move driver.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1581 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1582 * Signature of a callback function that releases the resources
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1583 * allocated by the given C-Move driver. This driver is the return
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1584 * value of a previous call to the OrthancPluginMoveCallback()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1585 * callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1586 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1587 * @param moveDriver The C-Move driver of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1588 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1589 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1590 typedef void (*OrthancPluginFreeMove) (void* moveDriver);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1591
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1592
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1593 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1594 * @brief Callback to finalize one custom job.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1595 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1596 * Signature of a callback function that releases all the resources
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1597 * allocated by the given job. This job is the argument provided to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1598 * OrthancPluginCreateJob().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1599 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1600 * @param job The job of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1601 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1602 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1603 typedef void (*OrthancPluginJobFinalize) (void* job);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1604
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1605
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1606 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1607 * @brief Callback to check the progress of one custom job.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1608 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1609 * Signature of a callback function that returns the progress of the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1610 * job.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1611 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1612 * @param job The job of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1613 * @return The progress, as a floating-point number ranging from 0 to 1.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1614 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1615 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1616 typedef float (*OrthancPluginJobGetProgress) (void* job);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1617
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1618
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1619 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1620 * @brief Callback to retrieve the content of one custom job.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1621 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1622 * Signature of a callback function that returns human-readable
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1623 * statistics about the job. This statistics must be formatted as a
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1624 * JSON object. This information is notably displayed in the "Jobs"
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1625 * tab of "Orthanc Explorer".
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1626 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1627 * @param job The job of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1628 * @return The statistics, as a JSON object encoded as a string.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1629 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1630 * @deprecated This signature should not be used anymore since Orthanc SDK 1.11.3.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1631 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1632 typedef const char* (*OrthancPluginJobGetContent) (void* job);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1633
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1634
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1635 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1636 * @brief Callback to retrieve the content of one custom job.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1637 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1638 * Signature of a callback function that returns human-readable
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1639 * statistics about the job. This statistics must be formatted as a
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1640 * JSON object. This information is notably displayed in the "Jobs"
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1641 * tab of "Orthanc Explorer".
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1642 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1643 * @param target The target memory buffer where to store the JSON string.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1644 * This buffer must be allocated using OrthancPluginCreateMemoryBuffer()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1645 * and will be freed by the Orthanc core.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1646 * @param job The job of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1647 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1648 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1649 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1650 typedef OrthancPluginErrorCode (*OrthancPluginJobGetContent2) (OrthancPluginMemoryBuffer* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1651 void* job);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1652
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1653
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1654 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1655 * @brief Callback to serialize one custom job.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1656 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1657 * Signature of a callback function that returns a serialized
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1658 * version of the job, formatted as a JSON object. This
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1659 * serialization is stored in the Orthanc database, and is used to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1660 * reload the job on the restart of Orthanc. The "unserialization"
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1661 * callback (with OrthancPluginJobsUnserializer signature) will
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1662 * receive this serialized object.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1663 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1664 * @param job The job of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1665 * @return The serialized job, as a JSON object encoded as a string.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1666 * @see OrthancPluginRegisterJobsUnserializer()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1667 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1668 * @deprecated This signature should not be used anymore since Orthanc SDK 1.11.3.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1669 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1670 typedef const char* (*OrthancPluginJobGetSerialized) (void* job);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1671
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1672
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1673 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1674 * @brief Callback to serialize one custom job.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1675 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1676 * Signature of a callback function that returns a serialized
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1677 * version of the job, formatted as a JSON object. This
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1678 * serialization is stored in the Orthanc database, and is used to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1679 * reload the job on the restart of Orthanc. The "unserialization"
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1680 * callback (with OrthancPluginJobsUnserializer signature) will
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1681 * receive this serialized object.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1682 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1683 * @param target The target memory buffer where to store the JSON string.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1684 * This buffer must be allocated using OrthancPluginCreateMemoryBuffer()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1685 * and will be freed by the Orthanc core.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1686 * @param job The job of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1687 * @return 1 if the serialization has succeeded, 0 if serialization is
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1688 * not implemented for this type of job, or -1 in case of error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1689 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1690 typedef int32_t (*OrthancPluginJobGetSerialized2) (OrthancPluginMemoryBuffer* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1691 void* job);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1692
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1693
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1694 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1695 * @brief Callback to execute one step of a custom job.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1696 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1697 * Signature of a callback function that executes one step in the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1698 * job. The jobs engine of Orthanc will make successive calls to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1699 * this method, as long as it returns
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1700 * OrthancPluginJobStepStatus_Continue.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1701 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1702 * @param job The job of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1703 * @return The status of execution.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1704 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1705 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1706 typedef OrthancPluginJobStepStatus (*OrthancPluginJobStep) (void* job);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1707
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1708
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1709 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1710 * @brief Callback executed once one custom job leaves the "running" state.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1711 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1712 * Signature of a callback function that is invoked once a job
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1713 * leaves the "running" state. This can happen if the previous call
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1714 * to OrthancPluginJobStep has failed/succeeded, if the host Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1715 * server is being stopped, or if the user manually tags the job as
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1716 * paused/canceled. This callback allows the plugin to free
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1717 * resources allocated for running this custom job (e.g. to stop
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1718 * threads, or to remove temporary files).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1719 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1720 * Note that handling pauses might involves a specific treatment
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1721 * (such a stopping threads, but keeping temporary files on the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1722 * disk). This "paused" situation can be checked by looking at the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1723 * "reason" parameter.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1724 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1725 * @param job The job of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1726 * @param reason The reason for leaving the "running" state.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1727 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1728 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1729 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1730 typedef OrthancPluginErrorCode (*OrthancPluginJobStop) (void* job,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1731 OrthancPluginJobStopReason reason);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1732
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1733
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1734 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1735 * @brief Callback executed once one stopped custom job is started again.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1736 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1737 * Signature of a callback function that is invoked once a job
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1738 * leaves the "failure/canceled" state, to be started again. This
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1739 * function will typically reset the progress to zero. Note that
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1740 * before being actually executed, the job would first be tagged as
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1741 * "pending" in the Orthanc jobs engine.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1742 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1743 * @param job The job of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1744 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1745 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1746 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1747 typedef OrthancPluginErrorCode (*OrthancPluginJobReset) (void* job);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1748
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1749
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1750 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1751 * @brief Callback executed to unserialize a custom job.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1752 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1753 * Signature of a callback function that unserializes a job that was
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1754 * saved in the Orthanc database.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1755 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1756 * @param jobType The type of the job, as provided to OrthancPluginCreateJob().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1757 * @param serialized The serialization of the job, as provided by OrthancPluginJobGetSerialized.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1758 * @return The unserialized job (as created by OrthancPluginCreateJob()), or NULL
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1759 * if this unserializer cannot handle this job type.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1760 * @see OrthancPluginRegisterJobsUnserializer()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1761 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1762 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1763 typedef OrthancPluginJob* (*OrthancPluginJobsUnserializer) (const char* jobType,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1764 const char* serialized);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1765
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1766
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1767
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1768 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1769 * @brief Callback executed to update the metrics of the plugin.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1770 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1771 * Signature of a callback function that is called by Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1772 * whenever a monitoring tool (such as Prometheus) asks the current
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1773 * values of the metrics. This callback gives the plugin a chance to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1774 * update its metrics, by calling OrthancPluginSetMetricsValue() or
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1775 * OrthancPluginSetMetricsIntegerValue().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1776 * This is typically useful for metrics that are expensive to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1777 * acquire.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1778 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1779 * @see OrthancPluginRegisterRefreshMetrics()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1780 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1781 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1782 typedef void (*OrthancPluginRefreshMetricsCallback) ();
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1783
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1784
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1785
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1786 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1787 * @brief Callback executed to encode a binary tag in DICOMweb.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1788 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1789 * Signature of a callback function that is called by Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1790 * whenever a DICOM tag that contains a binary value must be written
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1791 * to a JSON or XML node, while a DICOMweb document is being
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1792 * generated. The value representation (VR) of the DICOM tag can be
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1793 * OB, OD, OF, OL, OW, or UN.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1794 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1795 * @see OrthancPluginEncodeDicomWebJson() and OrthancPluginEncodeDicomWebXml()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1796 * @param node The node being generated, as provided by Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1797 * @param setter The setter to be used to encode the content of the node. If
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1798 * the setter is not called, the binary tag is not written to the output document.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1799 * @param levelDepth The depth of the node in the DICOM hierarchy of sequences.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1800 * This parameter gives the number of elements in the "levelTagGroup",
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1801 * "levelTagElement", and "levelIndex" arrays.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1802 * @param levelTagGroup The group of the parent DICOM tags in the hierarchy.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1803 * @param levelTagElement The element of the parent DICOM tags in the hierarchy.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1804 * @param levelIndex The index of the node in the parent sequences of the hierarchy.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1805 * @param tagGroup The group of the DICOM tag of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1806 * @param tagElement The element of the DICOM tag of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1807 * @param vr The value representation of the binary DICOM node.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1808 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1809 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1810 typedef void (*OrthancPluginDicomWebBinaryCallback) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1811 OrthancPluginDicomWebNode* node,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1812 OrthancPluginDicomWebSetBinaryNode setter,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1813 uint32_t levelDepth,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1814 const uint16_t* levelTagGroup,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1815 const uint16_t* levelTagElement,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1816 const uint32_t* levelIndex,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1817 uint16_t tagGroup,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1818 uint16_t tagElement,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1819 OrthancPluginValueRepresentation vr);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1820
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1821
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1822
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1823 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1824 * @brief Callback executed to encode a binary tag in DICOMweb.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1825 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1826 * Signature of a callback function that is called by Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1827 * whenever a DICOM tag that contains a binary value must be written
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1828 * to a JSON or XML node, while a DICOMweb document is being
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1829 * generated. The value representation (VR) of the DICOM tag can be
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1830 * OB, OD, OF, OL, OW, or UN.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1831 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1832 * @see OrthancPluginEncodeDicomWebJson() and OrthancPluginEncodeDicomWebXml()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1833 * @param node The node being generated, as provided by Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1834 * @param setter The setter to be used to encode the content of the node. If
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1835 * the setter is not called, the binary tag is not written to the output document.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1836 * @param levelDepth The depth of the node in the DICOM hierarchy of sequences.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1837 * This parameter gives the number of elements in the "levelTagGroup",
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1838 * "levelTagElement", and "levelIndex" arrays.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1839 * @param levelTagGroup The group of the parent DICOM tags in the hierarchy.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1840 * @param levelTagElement The element of the parent DICOM tags in the hierarchy.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1841 * @param levelIndex The index of the node in the parent sequences of the hierarchy.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1842 * @param tagGroup The group of the DICOM tag of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1843 * @param tagElement The element of the DICOM tag of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1844 * @param vr The value representation of the binary DICOM node.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1845 * @param payload The user payload.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1846 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1847 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1848 typedef void (*OrthancPluginDicomWebBinaryCallback2) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1849 OrthancPluginDicomWebNode* node,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1850 OrthancPluginDicomWebSetBinaryNode setter,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1851 uint32_t levelDepth,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1852 const uint16_t* levelTagGroup,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1853 const uint16_t* levelTagElement,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1854 const uint32_t* levelIndex,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1855 uint16_t tagGroup,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1856 uint16_t tagElement,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1857 OrthancPluginValueRepresentation vr,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1858 void* payload);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1859
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1860
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1861
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1862 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1863 * @brief Data structure that contains information about the Orthanc core.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1864 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1865 typedef struct _OrthancPluginContext_t
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1866 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1867 void* pluginsManager;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1868 const char* orthancVersion;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1869 OrthancPluginFree Free;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1870 OrthancPluginErrorCode (*InvokeService) (struct _OrthancPluginContext_t* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1871 _OrthancPluginService service,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1872 const void* params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1873 } OrthancPluginContext;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1874
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1875
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1876
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1877 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1878 * @brief An entry in the dictionary of DICOM tags.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1879 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1880 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1881 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1882 uint16_t group; /*!< The group of the tag */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1883 uint16_t element; /*!< The element of the tag */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1884 OrthancPluginValueRepresentation vr; /*!< The value representation of the tag */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1885 uint32_t minMultiplicity; /*!< The minimum multiplicity of the tag */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1886 uint32_t maxMultiplicity; /*!< The maximum multiplicity of the tag (0 means arbitrary) */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1887 } OrthancPluginDictionaryEntry;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1888
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1889
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1890
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1891 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1892 * @brief Free a string.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1893 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1894 * Free a string that was allocated by the core system of Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1895 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1896 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1897 * @param str The string to be freed.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1898 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1899 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeString(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1900 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1901 char* str)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1902 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1903 if (str != NULL)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1904 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1905 context->Free(str);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1906 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1907 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1908
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1909
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1910 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1911 * @brief Check that the version of the hosting Orthanc is above a given version.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1912 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1913 * This function checks whether the version of the Orthanc server
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1914 * running this plugin, is above the given version. Contrarily to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1915 * OrthancPluginCheckVersion(), it is up to the developer of the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1916 * plugin to make sure that all the Orthanc SDK services called by
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1917 * the plugin are actually implemented in the given version of
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1918 * Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1919 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1920 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1921 * @param expectedMajor Expected major version.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1922 * @param expectedMinor Expected minor version.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1923 * @param expectedRevision Expected revision.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1924 * @return 1 if and only if the versions are compatible. If the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1925 * result is 0, the initialization of the plugin should fail.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1926 * @see OrthancPluginCheckVersion()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1927 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1928 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1929 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginCheckVersionAdvanced(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1930 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1931 int32_t expectedMajor,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1932 int32_t expectedMinor,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1933 int32_t expectedRevision)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1934 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1935 int32_t major, minor, revision;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1936
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1937 if (sizeof(int) != sizeof(int32_t) || /* Ensure binary compatibility with Orthanc SDK <= 1.12.1 */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1938 sizeof(int32_t) != sizeof(OrthancPluginErrorCode) ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1939 sizeof(int32_t) != sizeof(OrthancPluginHttpMethod) ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1940 sizeof(int32_t) != sizeof(_OrthancPluginService) ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1941 sizeof(int32_t) != sizeof(_OrthancPluginProperty) ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1942 sizeof(int32_t) != sizeof(OrthancPluginPixelFormat) ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1943 sizeof(int32_t) != sizeof(OrthancPluginContentType) ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1944 sizeof(int32_t) != sizeof(OrthancPluginResourceType) ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1945 sizeof(int32_t) != sizeof(OrthancPluginChangeType) ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1946 sizeof(int32_t) != sizeof(OrthancPluginCompressionType) ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1947 sizeof(int32_t) != sizeof(OrthancPluginImageFormat) ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1948 sizeof(int32_t) != sizeof(OrthancPluginValueRepresentation) ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1949 sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFormat) ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1950 sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFlags) ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1951 sizeof(int32_t) != sizeof(OrthancPluginCreateDicomFlags) ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1952 sizeof(int32_t) != sizeof(OrthancPluginIdentifierConstraint) ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1953 sizeof(int32_t) != sizeof(OrthancPluginInstanceOrigin) ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1954 sizeof(int32_t) != sizeof(OrthancPluginJobStepStatus) ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1955 sizeof(int32_t) != sizeof(OrthancPluginConstraintType) ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1956 sizeof(int32_t) != sizeof(OrthancPluginMetricsType) ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1957 sizeof(int32_t) != sizeof(OrthancPluginDicomWebBinaryMode) ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1958 sizeof(int32_t) != sizeof(OrthancPluginStorageCommitmentFailureReason) ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1959 sizeof(int32_t) != sizeof(OrthancPluginLoadDicomInstanceMode))
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1960 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1961 /* Mismatch in the size of the enumerations */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1962 return 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1963 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1964
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1965 /* Assume compatibility with the mainline */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1966 if (!strcmp(context->orthancVersion, "mainline"))
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1967 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1968 return 1;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1969 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1970
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1971 /* Parse the version of the Orthanc core */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1972 if (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1973 #ifdef _MSC_VER
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1974 sscanf_s
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1975 #else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1976 sscanf
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1977 #endif
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1978 (context->orthancVersion, "%4d.%4d.%4d", &major, &minor, &revision) != 3)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1979 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1980 return 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1981 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1982
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1983 /* Check the major number of the version */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1984
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1985 if (major > expectedMajor)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1986 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1987 return 1;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1988 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1989
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1990 if (major < expectedMajor)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1991 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1992 return 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1993 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1994
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1995 /* Check the minor number of the version */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1996
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1997 if (minor > expectedMinor)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1998 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1999 return 1;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2000 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2001
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2002 if (minor < expectedMinor)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2003 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2004 return 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2005 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2006
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2007 /* Check the revision number of the version */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2008
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2009 if (revision >= expectedRevision)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2010 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2011 return 1;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2012 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2013 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2014 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2015 return 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2016 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2017 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2018
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2019
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2020 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2021 * @brief Check the compatibility of the plugin wrt. the version of its hosting Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2022 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2023 * This function checks whether the version of the Orthanc server
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2024 * running this plugin, is above the version of the current Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2025 * SDK header. This guarantees that the plugin is compatible with
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2026 * the hosting Orthanc (i.e. it will not call unavailable services).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2027 * The result of this function should always be checked in the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2028 * OrthancPluginInitialize() entry point of the plugin.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2029 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2030 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2031 * @return 1 if and only if the versions are compatible. If the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2032 * result is 0, the initialization of the plugin should fail.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2033 * @see OrthancPluginCheckVersionAdvanced()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2034 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2035 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2036 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginCheckVersion(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2037 OrthancPluginContext* context)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2038 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2039 return OrthancPluginCheckVersionAdvanced(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2040 context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2041 ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2042 ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2043 ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2044 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2045
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2046
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2047 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2048 * @brief Free a memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2049 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2050 * Free a memory buffer that was allocated by the core system of Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2051 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2052 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2053 * @param buffer The memory buffer to release.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2054 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2055 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeMemoryBuffer(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2056 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2057 OrthancPluginMemoryBuffer* buffer)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2058 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2059 context->Free(buffer->data);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2060 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2061
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2062
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2063 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2064 * @brief Free a memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2065 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2066 * Free a memory buffer that was allocated by the core system of Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2067 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2068 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2069 * @param buffer The memory buffer to release.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2070 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2071 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeMemoryBuffer64(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2072 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2073 OrthancPluginMemoryBuffer64* buffer)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2074 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2075 context->Free(buffer->data);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2076 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2077
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2078
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2079 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2080 * @brief Log an error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2081 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2082 * Log an error message using the Orthanc logging system.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2083 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2084 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2085 * @param message The message to be logged.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2086 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2087 ORTHANC_PLUGIN_INLINE void OrthancPluginLogError(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2088 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2089 const char* message)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2090 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2091 context->InvokeService(context, _OrthancPluginService_LogError, message);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2092 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2093
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2094
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2095 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2096 * @brief Log a warning.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2097 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2098 * Log a warning message using the Orthanc logging system.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2099 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2100 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2101 * @param message The message to be logged.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2102 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2103 ORTHANC_PLUGIN_INLINE void OrthancPluginLogWarning(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2104 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2105 const char* message)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2106 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2107 context->InvokeService(context, _OrthancPluginService_LogWarning, message);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2108 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2109
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2110
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2111 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2112 * @brief Log an information.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2113 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2114 * Log an information message using the Orthanc logging system.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2115 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2116 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2117 * @param message The message to be logged.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2118 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2119 ORTHANC_PLUGIN_INLINE void OrthancPluginLogInfo(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2120 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2121 const char* message)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2122 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2123 context->InvokeService(context, _OrthancPluginService_LogInfo, message);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2124 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2125
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2126
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2127
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2128 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2129 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2130 const char* pathRegularExpression;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2131 OrthancPluginRestCallback callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2132 } _OrthancPluginRestCallback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2133
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2134 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2135 * @brief Register a REST callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2136 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2137 * This function registers a REST callback against a regular
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2138 * expression for a URI. This function must be called during the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2139 * initialization of the plugin, i.e. inside the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2140 * OrthancPluginInitialize() public function.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2141 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2142 * Each REST callback is guaranteed to run in mutual exclusion.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2143 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2144 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2145 * @param pathRegularExpression Regular expression for the URI. May contain groups.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2146 * @param callback The callback function to handle the REST call.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2147 * @see OrthancPluginRegisterRestCallbackNoLock()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2148 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2149 * @note
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2150 * The regular expression is case sensitive and must follow the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2151 * [Perl syntax](https://www.boost.org/doc/libs/1_67_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2152 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2153 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2154 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2155 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallback(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2156 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2157 const char* pathRegularExpression,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2158 OrthancPluginRestCallback callback)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2159 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2160 _OrthancPluginRestCallback params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2161 params.pathRegularExpression = pathRegularExpression;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2162 params.callback = callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2163 context->InvokeService(context, _OrthancPluginService_RegisterRestCallback, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2164 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2165
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2166
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2167
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2168 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2169 * @brief Register a REST callback, without locking.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2170 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2171 * This function registers a REST callback against a regular
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2172 * expression for a URI. This function must be called during the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2173 * initialization of the plugin, i.e. inside the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2174 * OrthancPluginInitialize() public function.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2175 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2176 * Contrarily to OrthancPluginRegisterRestCallback(), the callback
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2177 * will NOT be invoked in mutual exclusion. This can be useful for
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2178 * high-performance plugins that must handle concurrent requests
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2179 * (Orthanc uses a pool of threads, one thread being assigned to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2180 * each incoming HTTP request). Of course, if using this function,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2181 * it is up to the plugin to implement the required locking
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2182 * mechanisms.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2183 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2184 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2185 * @param pathRegularExpression Regular expression for the URI. May contain groups.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2186 * @param callback The callback function to handle the REST call.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2187 * @see OrthancPluginRegisterRestCallback()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2188 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2189 * @note
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2190 * The regular expression is case sensitive and must follow the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2191 * [Perl syntax](https://www.boost.org/doc/libs/1_67_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2192 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2193 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2194 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2195 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallbackNoLock(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2196 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2197 const char* pathRegularExpression,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2198 OrthancPluginRestCallback callback)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2199 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2200 _OrthancPluginRestCallback params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2201 params.pathRegularExpression = pathRegularExpression;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2202 params.callback = callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2203 context->InvokeService(context, _OrthancPluginService_RegisterRestCallbackNoLock, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2204 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2205
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2206
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2207
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2208 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2209 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2210 OrthancPluginOnStoredInstanceCallback callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2211 } _OrthancPluginOnStoredInstanceCallback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2212
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2213 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2214 * @brief Register a callback for received instances.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2215 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2216 * This function registers a callback function that is called
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2217 * whenever a new DICOM instance is stored into the Orthanc core.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2218 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2219 * @warning Your callback function will be called synchronously with
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2220 * the core of Orthanc. This implies that deadlocks might emerge if
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2221 * you call other core primitives of Orthanc in your callback (such
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2222 * deadlocks are particularly visible in the presence of other plugins
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2223 * or Lua scripts). It is thus strongly advised to avoid any call to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2224 * the REST API of Orthanc in the callback. If you have to call
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2225 * other primitives of Orthanc, you should make these calls in a
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2226 * separate thread, passing the pending events to be processed
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2227 * through a message queue.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2228 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2229 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2230 * @param callback The callback function.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2231 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2232 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2233 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnStoredInstanceCallback(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2234 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2235 OrthancPluginOnStoredInstanceCallback callback)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2236 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2237 _OrthancPluginOnStoredInstanceCallback params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2238 params.callback = callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2239
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2240 context->InvokeService(context, _OrthancPluginService_RegisterOnStoredInstanceCallback, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2241 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2242
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2243
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2244
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2245 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2246 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2247 OrthancPluginRestOutput* output;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2248 const void* answer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2249 uint32_t answerSize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2250 const char* mimeType;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2251 } _OrthancPluginAnswerBuffer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2252
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2253 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2254 * @brief Answer to a REST request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2255 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2256 * This function answers to a REST request with the content of a memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2257 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2258 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2259 * @param output The HTTP connection to the client application.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2260 * @param answer Pointer to the memory buffer containing the answer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2261 * @param answerSize Number of bytes of the answer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2262 * @param mimeType The MIME type of the answer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2263 * @ingroup REST
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2264 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2265 ORTHANC_PLUGIN_INLINE void OrthancPluginAnswerBuffer(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2266 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2267 OrthancPluginRestOutput* output,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2268 const void* answer,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2269 uint32_t answerSize,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2270 const char* mimeType)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2271 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2272 _OrthancPluginAnswerBuffer params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2273 params.output = output;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2274 params.answer = answer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2275 params.answerSize = answerSize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2276 params.mimeType = mimeType;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2277 context->InvokeService(context, _OrthancPluginService_AnswerBuffer, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2278 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2279
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2280
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2281 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2282 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2283 OrthancPluginRestOutput* output;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2284 OrthancPluginPixelFormat format;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2285 uint32_t width;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2286 uint32_t height;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2287 uint32_t pitch;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2288 const void* buffer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2289 } _OrthancPluginCompressAndAnswerPngImage;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2290
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2291 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2292 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2293 OrthancPluginRestOutput* output;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2294 OrthancPluginImageFormat imageFormat;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2295 OrthancPluginPixelFormat pixelFormat;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2296 uint32_t width;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2297 uint32_t height;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2298 uint32_t pitch;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2299 const void* buffer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2300 uint8_t quality;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2301 } _OrthancPluginCompressAndAnswerImage;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2302
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2303
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2304 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2305 * @brief Answer to a REST request with a PNG image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2306 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2307 * This function answers to a REST request with a PNG image. The
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2308 * parameters of this function describe a memory buffer that
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2309 * contains an uncompressed image. The image will be automatically compressed
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2310 * as a PNG image by the core system of Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2311 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2312 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2313 * @param output The HTTP connection to the client application.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2314 * @param format The memory layout of the uncompressed image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2315 * @param width The width of the image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2316 * @param height The height of the image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2317 * @param pitch The pitch of the image (i.e. the number of bytes
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2318 * between 2 successive lines of the image in the memory buffer).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2319 * @param buffer The memory buffer containing the uncompressed image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2320 * @ingroup REST
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2321 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2322 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerPngImage(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2323 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2324 OrthancPluginRestOutput* output,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2325 OrthancPluginPixelFormat format,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2326 uint32_t width,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2327 uint32_t height,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2328 uint32_t pitch,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2329 const void* buffer)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2330 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2331 _OrthancPluginCompressAndAnswerImage params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2332 params.output = output;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2333 params.imageFormat = OrthancPluginImageFormat_Png;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2334 params.pixelFormat = format;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2335 params.width = width;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2336 params.height = height;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2337 params.pitch = pitch;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2338 params.buffer = buffer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2339 params.quality = 0; /* No quality for PNG */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2340 context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2341 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2342
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2343
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2344
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2345 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2346 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2347 OrthancPluginMemoryBuffer* target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2348 const char* instanceId;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2349 } _OrthancPluginGetDicomForInstance;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2350
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2351 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2352 * @brief Retrieve a DICOM instance using its Orthanc identifier.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2353 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2354 * Retrieve a DICOM instance using its Orthanc identifier. The DICOM
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2355 * file is stored into a newly allocated memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2356 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2357 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2358 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2359 * @param instanceId The Orthanc identifier of the DICOM instance of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2360 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2361 * @ingroup Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2362 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2363 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetDicomForInstance(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2364 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2365 OrthancPluginMemoryBuffer* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2366 const char* instanceId)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2367 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2368 _OrthancPluginGetDicomForInstance params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2369 params.target = target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2370 params.instanceId = instanceId;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2371 return context->InvokeService(context, _OrthancPluginService_GetDicomForInstance, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2372 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2373
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2374
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2375
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2376 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2377 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2378 OrthancPluginMemoryBuffer* target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2379 const char* uri;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2380 } _OrthancPluginRestApiGet;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2381
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2382 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2383 * @brief Make a GET call to the built-in Orthanc REST API.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2384 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2385 * Make a GET call to the built-in Orthanc REST API. The result to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2386 * the query is stored into a newly allocated memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2387 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2388 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2389 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2390 * @param uri The URI in the built-in Orthanc API.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2391 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2392 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2393 * @see OrthancPluginRestApiGetAfterPlugins()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2394 * @ingroup Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2395 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2396 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2397 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2398 OrthancPluginMemoryBuffer* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2399 const char* uri)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2400 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2401 _OrthancPluginRestApiGet params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2402 params.target = target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2403 params.uri = uri;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2404 return context->InvokeService(context, _OrthancPluginService_RestApiGet, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2405 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2406
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2407
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2408
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2409 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2410 * @brief Make a GET call to the REST API, as tainted by the plugins.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2411 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2412 * Make a GET call to the Orthanc REST API, after all the plugins
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2413 * are applied. In other words, if some plugin overrides or adds the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2414 * called URI to the built-in Orthanc REST API, this call will
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2415 * return the result provided by this plugin. The result to the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2416 * query is stored into a newly allocated memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2417 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2418 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2419 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2420 * @param uri The URI in the built-in Orthanc API.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2421 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2422 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2423 * @see OrthancPluginRestApiGet()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2424 * @ingroup Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2425 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2426 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGetAfterPlugins(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2427 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2428 OrthancPluginMemoryBuffer* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2429 const char* uri)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2430 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2431 _OrthancPluginRestApiGet params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2432 params.target = target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2433 params.uri = uri;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2434 return context->InvokeService(context, _OrthancPluginService_RestApiGetAfterPlugins, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2435 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2436
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2437
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2438
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2439 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2440 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2441 OrthancPluginMemoryBuffer* target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2442 const char* uri;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2443 const void* body;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2444 uint32_t bodySize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2445 } _OrthancPluginRestApiPostPut;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2446
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2447 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2448 * @brief Make a POST call to the built-in Orthanc REST API.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2449 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2450 * Make a POST call to the built-in Orthanc REST API. The result to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2451 * the query is stored into a newly allocated memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2452 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2453 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2454 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2455 * @param uri The URI in the built-in Orthanc API.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2456 * @param body The body of the POST request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2457 * @param bodySize The size of the body.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2458 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2459 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2460 * @see OrthancPluginRestApiPostAfterPlugins()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2461 * @ingroup Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2462 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2463 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPost(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2464 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2465 OrthancPluginMemoryBuffer* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2466 const char* uri,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2467 const void* body,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2468 uint32_t bodySize)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2469 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2470 _OrthancPluginRestApiPostPut params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2471 params.target = target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2472 params.uri = uri;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2473 params.body = body;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2474 params.bodySize = bodySize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2475 return context->InvokeService(context, _OrthancPluginService_RestApiPost, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2476 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2477
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2478
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2479 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2480 * @brief Make a POST call to the REST API, as tainted by the plugins.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2481 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2482 * Make a POST call to the Orthanc REST API, after all the plugins
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2483 * are applied. In other words, if some plugin overrides or adds the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2484 * called URI to the built-in Orthanc REST API, this call will
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2485 * return the result provided by this plugin. The result to the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2486 * query is stored into a newly allocated memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2487 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2488 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2489 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2490 * @param uri The URI in the built-in Orthanc API.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2491 * @param body The body of the POST request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2492 * @param bodySize The size of the body.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2493 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2494 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2495 * @see OrthancPluginRestApiPost()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2496 * @ingroup Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2497 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2498 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPostAfterPlugins(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2499 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2500 OrthancPluginMemoryBuffer* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2501 const char* uri,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2502 const void* body,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2503 uint32_t bodySize)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2504 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2505 _OrthancPluginRestApiPostPut params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2506 params.target = target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2507 params.uri = uri;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2508 params.body = body;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2509 params.bodySize = bodySize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2510 return context->InvokeService(context, _OrthancPluginService_RestApiPostAfterPlugins, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2511 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2512
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2513
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2514
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2515 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2516 * @brief Make a DELETE call to the built-in Orthanc REST API.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2517 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2518 * Make a DELETE call to the built-in Orthanc REST API.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2519 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2520 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2521 * @param uri The URI to delete in the built-in Orthanc API.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2522 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2523 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2524 * @see OrthancPluginRestApiDeleteAfterPlugins()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2525 * @ingroup Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2526 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2527 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDelete(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2528 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2529 const char* uri)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2530 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2531 return context->InvokeService(context, _OrthancPluginService_RestApiDelete, uri);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2532 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2533
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2534
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2535 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2536 * @brief Make a DELETE call to the REST API, as tainted by the plugins.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2537 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2538 * Make a DELETE call to the Orthanc REST API, after all the plugins
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2539 * are applied. In other words, if some plugin overrides or adds the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2540 * called URI to the built-in Orthanc REST API, this call will
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2541 * return the result provided by this plugin.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2542 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2543 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2544 * @param uri The URI to delete in the built-in Orthanc API.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2545 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2546 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2547 * @see OrthancPluginRestApiDelete()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2548 * @ingroup Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2549 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2550 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiDeleteAfterPlugins(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2551 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2552 const char* uri)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2553 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2554 return context->InvokeService(context, _OrthancPluginService_RestApiDeleteAfterPlugins, uri);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2555 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2556
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2557
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2558
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2559 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2560 * @brief Make a PUT call to the built-in Orthanc REST API.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2561 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2562 * Make a PUT call to the built-in Orthanc REST API. The result to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2563 * the query is stored into a newly allocated memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2564 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2565 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2566 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2567 * @param uri The URI in the built-in Orthanc API.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2568 * @param body The body of the PUT request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2569 * @param bodySize The size of the body.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2570 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2571 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2572 * @see OrthancPluginRestApiPutAfterPlugins()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2573 * @ingroup Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2574 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2575 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPut(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2576 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2577 OrthancPluginMemoryBuffer* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2578 const char* uri,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2579 const void* body,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2580 uint32_t bodySize)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2581 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2582 _OrthancPluginRestApiPostPut params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2583 params.target = target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2584 params.uri = uri;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2585 params.body = body;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2586 params.bodySize = bodySize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2587 return context->InvokeService(context, _OrthancPluginService_RestApiPut, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2588 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2589
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2590
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2591
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2592 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2593 * @brief Make a PUT call to the REST API, as tainted by the plugins.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2594 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2595 * Make a PUT call to the Orthanc REST API, after all the plugins
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2596 * are applied. In other words, if some plugin overrides or adds the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2597 * called URI to the built-in Orthanc REST API, this call will
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2598 * return the result provided by this plugin. The result to the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2599 * query is stored into a newly allocated memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2600 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2601 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2602 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2603 * @param uri The URI in the built-in Orthanc API.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2604 * @param body The body of the PUT request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2605 * @param bodySize The size of the body.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2606 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2607 * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2608 * @see OrthancPluginRestApiPut()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2609 * @ingroup Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2610 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2611 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiPutAfterPlugins(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2612 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2613 OrthancPluginMemoryBuffer* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2614 const char* uri,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2615 const void* body,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2616 uint32_t bodySize)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2617 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2618 _OrthancPluginRestApiPostPut params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2619 params.target = target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2620 params.uri = uri;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2621 params.body = body;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2622 params.bodySize = bodySize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2623 return context->InvokeService(context, _OrthancPluginService_RestApiPutAfterPlugins, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2624 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2625
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2626
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2627
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2628 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2629 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2630 OrthancPluginRestOutput* output;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2631 const char* argument;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2632 } _OrthancPluginOutputPlusArgument;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2633
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2634 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2635 * @brief Redirect a REST request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2636 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2637 * This function answers to a REST request by redirecting the user
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2638 * to another URI using HTTP status 301.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2639 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2640 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2641 * @param output The HTTP connection to the client application.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2642 * @param redirection Where to redirect.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2643 * @ingroup REST
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2644 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2645 ORTHANC_PLUGIN_INLINE void OrthancPluginRedirect(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2646 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2647 OrthancPluginRestOutput* output,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2648 const char* redirection)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2649 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2650 _OrthancPluginOutputPlusArgument params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2651 params.output = output;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2652 params.argument = redirection;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2653 context->InvokeService(context, _OrthancPluginService_Redirect, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2654 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2655
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2656
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2657
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2658 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2659 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2660 char** result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2661 const char* argument;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2662 } _OrthancPluginRetrieveDynamicString;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2663
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2664 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2665 * @brief Look for a patient.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2666 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2667 * Look for a patient stored in Orthanc, using its Patient ID tag (0x0010, 0x0020).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2668 * This function uses the database index to run as fast as possible (it does not loop
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2669 * over all the stored patients).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2670 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2671 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2672 * @param patientID The Patient ID of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2673 * @return The NULL value if the patient is non-existent, or a string containing the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2674 * Orthanc ID of the patient. This string must be freed by OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2675 * @ingroup Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2676 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2677 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupPatient(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2678 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2679 const char* patientID)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2680 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2681 char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2682
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2683 _OrthancPluginRetrieveDynamicString params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2684 params.result = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2685 params.argument = patientID;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2686
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2687 if (context->InvokeService(context, _OrthancPluginService_LookupPatient, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2688 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2689 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2690 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2691 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2692 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2693 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2694 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2695 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2696 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2697
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2698
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2699 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2700 * @brief Look for a study.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2701 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2702 * Look for a study stored in Orthanc, using its Study Instance UID tag (0x0020, 0x000d).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2703 * This function uses the database index to run as fast as possible (it does not loop
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2704 * over all the stored studies).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2705 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2706 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2707 * @param studyUID The Study Instance UID of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2708 * @return The NULL value if the study is non-existent, or a string containing the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2709 * Orthanc ID of the study. This string must be freed by OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2710 * @ingroup Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2711 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2712 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudy(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2713 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2714 const char* studyUID)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2715 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2716 char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2717
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2718 _OrthancPluginRetrieveDynamicString params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2719 params.result = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2720 params.argument = studyUID;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2721
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2722 if (context->InvokeService(context, _OrthancPluginService_LookupStudy, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2723 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2724 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2725 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2726 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2727 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2728 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2729 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2730 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2731 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2732
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2733
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2734 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2735 * @brief Look for a study, using the accession number.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2736 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2737 * Look for a study stored in Orthanc, using its Accession Number tag (0x0008, 0x0050).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2738 * This function uses the database index to run as fast as possible (it does not loop
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2739 * over all the stored studies).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2740 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2741 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2742 * @param accessionNumber The Accession Number of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2743 * @return The NULL value if the study is non-existent, or a string containing the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2744 * Orthanc ID of the study. This string must be freed by OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2745 * @ingroup Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2746 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2747 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudyWithAccessionNumber(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2748 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2749 const char* accessionNumber)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2750 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2751 char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2752
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2753 _OrthancPluginRetrieveDynamicString params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2754 params.result = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2755 params.argument = accessionNumber;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2756
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2757 if (context->InvokeService(context, _OrthancPluginService_LookupStudyWithAccessionNumber, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2758 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2759 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2760 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2761 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2762 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2763 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2764 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2765 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2766 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2767
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2768
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2769 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2770 * @brief Look for a series.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2771 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2772 * Look for a series stored in Orthanc, using its Series Instance UID tag (0x0020, 0x000e).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2773 * This function uses the database index to run as fast as possible (it does not loop
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2774 * over all the stored series).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2775 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2776 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2777 * @param seriesUID The Series Instance UID of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2778 * @return The NULL value if the series is non-existent, or a string containing the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2779 * Orthanc ID of the series. This string must be freed by OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2780 * @ingroup Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2781 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2782 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupSeries(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2783 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2784 const char* seriesUID)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2785 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2786 char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2787
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2788 _OrthancPluginRetrieveDynamicString params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2789 params.result = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2790 params.argument = seriesUID;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2791
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2792 if (context->InvokeService(context, _OrthancPluginService_LookupSeries, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2793 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2794 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2795 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2796 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2797 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2798 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2799 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2800 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2801 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2802
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2803
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2804 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2805 * @brief Look for an instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2806 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2807 * Look for an instance stored in Orthanc, using its SOP Instance UID tag (0x0008, 0x0018).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2808 * This function uses the database index to run as fast as possible (it does not loop
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2809 * over all the stored instances).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2810 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2811 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2812 * @param sopInstanceUID The SOP Instance UID of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2813 * @return The NULL value if the instance is non-existent, or a string containing the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2814 * Orthanc ID of the instance. This string must be freed by OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2815 * @ingroup Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2816 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2817 ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupInstance(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2818 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2819 const char* sopInstanceUID)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2820 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2821 char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2822
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2823 _OrthancPluginRetrieveDynamicString params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2824 params.result = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2825 params.argument = sopInstanceUID;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2826
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2827 if (context->InvokeService(context, _OrthancPluginService_LookupInstance, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2828 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2829 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2830 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2831 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2832 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2833 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2834 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2835 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2836 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2837
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2838
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2839
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2840 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2841 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2842 OrthancPluginRestOutput* output;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2843 uint16_t status;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2844 } _OrthancPluginSendHttpStatusCode;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2845
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2846 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2847 * @brief Send a HTTP status code.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2848 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2849 * This function answers to a REST request by sending a HTTP status
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2850 * code (such as "400 - Bad Request"). Note that:
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2851 * - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2852 * - Redirections (status 301) must use ::OrthancPluginRedirect().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2853 * - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2854 * - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2855 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2856 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2857 * @param output The HTTP connection to the client application.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2858 * @param status The HTTP status code to be sent.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2859 * @ingroup REST
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2860 * @see OrthancPluginSendHttpStatus()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2861 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2862 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatusCode(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2863 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2864 OrthancPluginRestOutput* output,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2865 uint16_t status)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2866 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2867 _OrthancPluginSendHttpStatusCode params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2868 params.output = output;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2869 params.status = status;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2870 context->InvokeService(context, _OrthancPluginService_SendHttpStatusCode, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2871 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2872
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2873
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2874 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2875 * @brief Signal that a REST request is not authorized.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2876 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2877 * This function answers to a REST request by signaling that it is
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2878 * not authorized.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2879 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2880 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2881 * @param output The HTTP connection to the client application.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2882 * @param realm The realm for the authorization process.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2883 * @ingroup REST
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2884 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2885 ORTHANC_PLUGIN_INLINE void OrthancPluginSendUnauthorized(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2886 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2887 OrthancPluginRestOutput* output,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2888 const char* realm)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2889 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2890 _OrthancPluginOutputPlusArgument params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2891 params.output = output;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2892 params.argument = realm;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2893 context->InvokeService(context, _OrthancPluginService_SendUnauthorized, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2894 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2895
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2896
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2897 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2898 * @brief Signal that this URI does not support this HTTP method.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2899 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2900 * This function answers to a REST request by signaling that the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2901 * queried URI does not support this method.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2902 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2903 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2904 * @param output The HTTP connection to the client application.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2905 * @param allowedMethods The allowed methods for this URI (e.g. "GET,POST" after a PUT or a POST request).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2906 * @ingroup REST
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2907 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2908 ORTHANC_PLUGIN_INLINE void OrthancPluginSendMethodNotAllowed(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2909 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2910 OrthancPluginRestOutput* output,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2911 const char* allowedMethods)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2912 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2913 _OrthancPluginOutputPlusArgument params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2914 params.output = output;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2915 params.argument = allowedMethods;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2916 context->InvokeService(context, _OrthancPluginService_SendMethodNotAllowed, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2917 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2918
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2919
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2920 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2921 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2922 OrthancPluginRestOutput* output;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2923 const char* key;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2924 const char* value;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2925 } _OrthancPluginSetHttpHeader;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2926
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2927 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2928 * @brief Set a cookie.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2929 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2930 * This function sets a cookie in the HTTP client.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2931 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2932 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2933 * @param output The HTTP connection to the client application.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2934 * @param cookie The cookie to be set.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2935 * @param value The value of the cookie.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2936 * @ingroup REST
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2937 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2938 ORTHANC_PLUGIN_INLINE void OrthancPluginSetCookie(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2939 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2940 OrthancPluginRestOutput* output,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2941 const char* cookie,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2942 const char* value)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2943 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2944 _OrthancPluginSetHttpHeader params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2945 params.output = output;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2946 params.key = cookie;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2947 params.value = value;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2948 context->InvokeService(context, _OrthancPluginService_SetCookie, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2949 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2950
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2951
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2952 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2953 * @brief Set some HTTP header.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2954 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2955 * This function sets a HTTP header in the HTTP answer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2956 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2957 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2958 * @param output The HTTP connection to the client application.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2959 * @param key The HTTP header to be set.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2960 * @param value The value of the HTTP header.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2961 * @ingroup REST
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2962 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2963 ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpHeader(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2964 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2965 OrthancPluginRestOutput* output,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2966 const char* key,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2967 const char* value)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2968 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2969 _OrthancPluginSetHttpHeader params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2970 params.output = output;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2971 params.key = key;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2972 params.value = value;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2973 context->InvokeService(context, _OrthancPluginService_SetHttpHeader, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2974 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2975
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2976
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2977 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2978 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2979 char** resultStringToFree;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2980 const char** resultString;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2981 int64_t* resultInt64;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2982 const char* key;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2983 const OrthancPluginDicomInstance* instance;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2984 OrthancPluginInstanceOrigin* resultOrigin; /* New in Orthanc 0.9.5 SDK */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2985 } _OrthancPluginAccessDicomInstance;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2986
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2987
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2988 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2989 * @brief Get the AET of a DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2990 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2991 * This function returns the Application Entity Title (AET) of the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2992 * DICOM modality from which a DICOM instance originates.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2993 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2994 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2995 * @param instance The instance of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2996 * @return The AET if success, NULL if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2997 * @ingroup DicomInstance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2998 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2999 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceRemoteAet(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3000 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3001 const OrthancPluginDicomInstance* instance)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3002 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3003 const char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3004
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3005 _OrthancPluginAccessDicomInstance params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3006 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3007 params.resultString = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3008 params.instance = instance;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3009
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3010 if (context->InvokeService(context, _OrthancPluginService_GetInstanceRemoteAet, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3011 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3012 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3013 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3014 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3015 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3016 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3017 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3018 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3019 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3020
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3021
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3022 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3023 * @brief Get the size of a DICOM file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3024 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3025 * This function returns the number of bytes of the given DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3026 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3027 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3028 * @param instance The instance of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3029 * @return The size of the file, -1 in case of error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3030 * @ingroup DicomInstance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3031 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3032 ORTHANC_PLUGIN_INLINE int64_t OrthancPluginGetInstanceSize(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3033 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3034 const OrthancPluginDicomInstance* instance)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3035 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3036 int64_t size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3037
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3038 _OrthancPluginAccessDicomInstance params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3039 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3040 params.resultInt64 = &size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3041 params.instance = instance;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3042
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3043 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSize, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3044 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3045 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3046 return -1;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3047 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3048 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3049 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3050 return size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3051 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3052 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3053
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3054
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3055 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3056 * @brief Get the data of a DICOM file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3057 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3058 * This function returns a pointer to the content of the given DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3059 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3060 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3061 * @param instance The instance of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3062 * @return The pointer to the DICOM data, NULL in case of error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3063 * @ingroup DicomInstance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3064 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3065 ORTHANC_PLUGIN_INLINE const void* OrthancPluginGetInstanceData(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3066 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3067 const OrthancPluginDicomInstance* instance)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3068 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3069 const char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3070
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3071 _OrthancPluginAccessDicomInstance params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3072 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3073 params.resultString = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3074 params.instance = instance;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3075
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3076 if (context->InvokeService(context, _OrthancPluginService_GetInstanceData, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3077 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3078 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3079 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3080 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3081 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3082 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3083 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3084 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3085 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3086
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3087
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3088 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3089 * @brief Get the DICOM tag hierarchy as a JSON file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3090 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3091 * This function returns a pointer to a newly created string
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3092 * containing a JSON file. This JSON file encodes the tag hierarchy
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3093 * of the given DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3094 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3095 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3096 * @param instance The instance of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3097 * @return The NULL value in case of error, or a string containing the JSON file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3098 * This string must be freed by OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3099 * @ingroup DicomInstance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3100 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3101 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceJson(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3102 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3103 const OrthancPluginDicomInstance* instance)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3104 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3105 char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3106
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3107 _OrthancPluginAccessDicomInstance params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3108 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3109 params.resultStringToFree = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3110 params.instance = instance;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3111
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3112 if (context->InvokeService(context, _OrthancPluginService_GetInstanceJson, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3113 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3114 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3115 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3116 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3117 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3118 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3119 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3120 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3121 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3122
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3123
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3124 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3125 * @brief Get the DICOM tag hierarchy as a JSON file (with simplification).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3126 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3127 * This function returns a pointer to a newly created string
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3128 * containing a JSON file. This JSON file encodes the tag hierarchy
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3129 * of the given DICOM instance. In contrast with
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3130 * ::OrthancPluginGetInstanceJson(), the returned JSON file is in
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3131 * its simplified version.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3132 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3133 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3134 * @param instance The instance of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3135 * @return The NULL value in case of error, or a string containing the JSON file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3136 * This string must be freed by OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3137 * @ingroup DicomInstance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3138 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3139 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceSimplifiedJson(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3140 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3141 const OrthancPluginDicomInstance* instance)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3142 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3143 char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3144
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3145 _OrthancPluginAccessDicomInstance params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3146 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3147 params.resultStringToFree = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3148 params.instance = instance;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3149
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3150 if (context->InvokeService(context, _OrthancPluginService_GetInstanceSimplifiedJson, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3151 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3152 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3153 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3154 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3155 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3156 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3157 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3158 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3159 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3160
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3161
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3162 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3163 * @brief Check whether a DICOM instance is associated with some metadata.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3164 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3165 * This function checks whether the DICOM instance of interest is
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3166 * associated with some metadata. As of Orthanc 0.8.1, in the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3167 * callbacks registered by
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3168 * ::OrthancPluginRegisterOnStoredInstanceCallback(), the only
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3169 * possibly available metadata are "ReceptionDate", "RemoteAET" and
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3170 * "IndexInSeries".
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3171 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3172 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3173 * @param instance The instance of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3174 * @param metadata The metadata of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3175 * @return 1 if the metadata is present, 0 if it is absent, -1 in case of error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3176 * @ingroup DicomInstance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3177 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3178 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginHasInstanceMetadata(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3179 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3180 const OrthancPluginDicomInstance* instance,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3181 const char* metadata)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3182 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3183 int64_t result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3184
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3185 _OrthancPluginAccessDicomInstance params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3186 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3187 params.resultInt64 = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3188 params.instance = instance;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3189 params.key = metadata;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3190
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3191 if (context->InvokeService(context, _OrthancPluginService_HasInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3192 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3193 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3194 return -1;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3195 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3196 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3197 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3198 return (result != 0);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3199 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3200 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3201
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3202
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3203 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3204 * @brief Get the value of some metadata associated with a given DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3205 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3206 * This functions returns the value of some metadata that is associated with the DICOM instance of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3207 * Before calling this function, the existence of the metadata must have been checked with
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3208 * ::OrthancPluginHasInstanceMetadata().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3209 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3210 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3211 * @param instance The instance of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3212 * @param metadata The metadata of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3213 * @return The metadata value if success, NULL if error. Please note that the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3214 * returned string belongs to the instance object and must NOT be
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3215 * deallocated. Please make a copy of the string if you wish to access
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3216 * it later.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3217 * @ingroup DicomInstance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3218 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3219 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceMetadata(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3220 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3221 const OrthancPluginDicomInstance* instance,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3222 const char* metadata)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3223 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3224 const char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3225
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3226 _OrthancPluginAccessDicomInstance params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3227 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3228 params.resultString = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3229 params.instance = instance;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3230 params.key = metadata;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3231
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3232 if (context->InvokeService(context, _OrthancPluginService_GetInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3233 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3234 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3235 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3236 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3237 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3238 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3239 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3240 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3241 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3242
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3243
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3244
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3245 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3246 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3247 OrthancPluginStorageCreate create;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3248 OrthancPluginStorageRead read;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3249 OrthancPluginStorageRemove remove;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3250 OrthancPluginFree free;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3251 } _OrthancPluginRegisterStorageArea;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3252
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3253 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3254 * @brief Register a custom storage area.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3255 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3256 * This function registers a custom storage area, to replace the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3257 * built-in way Orthanc stores its files on the filesystem. This
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3258 * function must be called during the initialization of the plugin,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3259 * i.e. inside the OrthancPluginInitialize() public function.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3260 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3261 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3262 * @param create The callback function to store a file on the custom storage area.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3263 * @param read The callback function to read a file from the custom storage area.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3264 * @param remove The callback function to remove a file from the custom storage area.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3265 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3266 * @deprecated Please use OrthancPluginRegisterStorageArea2()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3267 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3268 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterStorageArea(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3269 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3270 OrthancPluginStorageCreate create,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3271 OrthancPluginStorageRead read,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3272 OrthancPluginStorageRemove remove)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3273 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3274 _OrthancPluginRegisterStorageArea params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3275 params.create = create;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3276 params.read = read;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3277 params.remove = remove;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3278
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3279 #ifdef __cplusplus
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3280 params.free = ::free;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3281 #else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3282 params.free = free;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3283 #endif
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3284
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3285 context->InvokeService(context, _OrthancPluginService_RegisterStorageArea, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3286 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3287
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3288
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3289
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3290 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3291 * @brief Return the path to the Orthanc executable.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3292 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3293 * This function returns the path to the Orthanc executable.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3294 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3295 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3296 * @return NULL in the case of an error, or a newly allocated string
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3297 * containing the path. This string must be freed by
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3298 * OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3299 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3300 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancPath(OrthancPluginContext* context)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3301 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3302 char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3303
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3304 _OrthancPluginRetrieveDynamicString params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3305 params.result = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3306 params.argument = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3307
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3308 if (context->InvokeService(context, _OrthancPluginService_GetOrthancPath, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3309 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3310 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3311 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3312 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3313 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3314 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3315 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3316 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3317 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3318
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3319
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3320 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3321 * @brief Return the directory containing the Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3322 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3323 * This function returns the path to the directory containing the Orthanc executable.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3324 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3325 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3326 * @return NULL in the case of an error, or a newly allocated string
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3327 * containing the path. This string must be freed by
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3328 * OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3329 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3330 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancDirectory(OrthancPluginContext* context)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3331 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3332 char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3333
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3334 _OrthancPluginRetrieveDynamicString params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3335 params.result = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3336 params.argument = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3337
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3338 if (context->InvokeService(context, _OrthancPluginService_GetOrthancDirectory, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3339 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3340 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3341 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3342 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3343 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3344 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3345 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3346 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3347 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3348
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3349
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3350 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3351 * @brief Return the path to the configuration file(s).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3352 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3353 * This function returns the path to the configuration file(s) that
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3354 * was specified when starting Orthanc. Since version 0.9.1, this
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3355 * path can refer to a folder that stores a set of configuration
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3356 * files. This function is deprecated in favor of
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3357 * OrthancPluginGetConfiguration().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3358 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3359 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3360 * @return NULL in the case of an error, or a newly allocated string
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3361 * containing the path. This string must be freed by
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3362 * OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3363 * @see OrthancPluginGetConfiguration()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3364 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3365 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfigurationPath(OrthancPluginContext* context)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3366 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3367 char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3368
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3369 _OrthancPluginRetrieveDynamicString params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3370 params.result = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3371 params.argument = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3372
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3373 if (context->InvokeService(context, _OrthancPluginService_GetConfigurationPath, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3374 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3375 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3376 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3377 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3378 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3379 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3380 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3381 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3382 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3383
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3384
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3385
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3386 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3387 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3388 OrthancPluginOnChangeCallback callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3389 } _OrthancPluginOnChangeCallback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3390
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3391 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3392 * @brief Register a callback to monitor changes.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3393 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3394 * This function registers a callback function that is called
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3395 * whenever a change happens to some DICOM resource.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3396 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3397 * @warning Your callback function will be called synchronously with
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3398 * the core of Orthanc. This implies that deadlocks might emerge if
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3399 * you call other core primitives of Orthanc in your callback (such
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3400 * deadlocks are particularly visible in the presence of other plugins
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3401 * or Lua scripts). It is thus strongly advised to avoid any call to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3402 * the REST API of Orthanc in the callback. If you have to call
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3403 * other primitives of Orthanc, you should make these calls in a
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3404 * separate thread, passing the pending events to be processed
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3405 * through a message queue.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3406 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3407 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3408 * @param callback The callback function.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3409 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3410 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3411 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnChangeCallback(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3412 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3413 OrthancPluginOnChangeCallback callback)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3414 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3415 _OrthancPluginOnChangeCallback params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3416 params.callback = callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3417
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3418 context->InvokeService(context, _OrthancPluginService_RegisterOnChangeCallback, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3419 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3420
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3421
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3422
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3423 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3424 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3425 const char* plugin;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3426 _OrthancPluginProperty property;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3427 const char* value;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3428 } _OrthancPluginSetPluginProperty;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3429
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3430
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3431 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3432 * @brief Set the URI where the plugin provides its Web interface.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3433 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3434 * For plugins that come with a Web interface, this function
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3435 * declares the entry path where to find this interface. This
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3436 * information is notably used in the "Plugins" page of Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3437 * Explorer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3438 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3439 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3440 * @param uri The root URI for this plugin.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3441 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3442 ORTHANC_PLUGIN_INLINE void OrthancPluginSetRootUri(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3443 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3444 const char* uri)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3445 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3446 _OrthancPluginSetPluginProperty params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3447 params.plugin = OrthancPluginGetName();
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3448 params.property = _OrthancPluginProperty_RootUri;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3449 params.value = uri;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3450
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3451 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3452 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3453
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3454
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3455 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3456 * @brief Set a description for this plugin.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3457 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3458 * Set a description for this plugin. It is displayed in the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3459 * "Plugins" page of Orthanc Explorer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3460 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3461 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3462 * @param description The description.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3463 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3464 ORTHANC_PLUGIN_INLINE void OrthancPluginSetDescription(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3465 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3466 const char* description)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3467 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3468 _OrthancPluginSetPluginProperty params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3469 params.plugin = OrthancPluginGetName();
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3470 params.property = _OrthancPluginProperty_Description;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3471 params.value = description;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3472
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3473 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3474 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3475
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3476
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3477 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3478 * @brief Extend the JavaScript code of Orthanc Explorer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3479 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3480 * Add JavaScript code to customize the default behavior of Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3481 * Explorer. This can for instance be used to add new buttons.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3482 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3483 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3484 * @param javascript The custom JavaScript code.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3485 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3486 ORTHANC_PLUGIN_INLINE void OrthancPluginExtendOrthancExplorer(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3487 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3488 const char* javascript)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3489 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3490 _OrthancPluginSetPluginProperty params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3491 params.plugin = OrthancPluginGetName();
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3492 params.property = _OrthancPluginProperty_OrthancExplorer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3493 params.value = javascript;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3494
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3495 context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3496 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3497
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3498
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3499 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3500 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3501 char** result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3502 int32_t property;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3503 const char* value;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3504 } _OrthancPluginGlobalProperty;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3505
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3506
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3507 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3508 * @brief Get the value of a global property.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3509 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3510 * Get the value of a global property that is stored in the Orthanc database. Global
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3511 * properties whose index is below 1024 are reserved by Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3512 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3513 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3514 * @param property The global property of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3515 * @param defaultValue The value to return, if the global property is unset.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3516 * @return The value of the global property, or NULL in the case of an error. This
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3517 * string must be freed by OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3518 * @ingroup Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3519 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3520 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetGlobalProperty(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3521 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3522 int32_t property,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3523 const char* defaultValue)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3524 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3525 char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3526
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3527 _OrthancPluginGlobalProperty params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3528 params.result = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3529 params.property = property;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3530 params.value = defaultValue;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3531
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3532 if (context->InvokeService(context, _OrthancPluginService_GetGlobalProperty, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3533 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3534 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3535 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3536 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3537 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3538 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3539 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3540 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3541 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3542
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3543
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3544 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3545 * @brief Set the value of a global property.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3546 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3547 * Set the value of a global property into the Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3548 * database. Setting a global property can be used by plugins to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3549 * save their internal parameters. Plugins are only allowed to set
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3550 * properties whose index are above or equal to 1024 (properties
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3551 * below 1024 are read-only and reserved by Orthanc).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3552 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3553 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3554 * @param property The global property of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3555 * @param value The value to be set in the global property.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3556 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3557 * @ingroup Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3558 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3559 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSetGlobalProperty(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3560 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3561 int32_t property,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3562 const char* value)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3563 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3564 _OrthancPluginGlobalProperty params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3565 params.result = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3566 params.property = property;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3567 params.value = value;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3568
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3569 return context->InvokeService(context, _OrthancPluginService_SetGlobalProperty, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3570 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3571
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3572
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3573
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3574 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3575 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3576 int32_t *resultInt32;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3577 uint32_t *resultUint32;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3578 int64_t *resultInt64;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3579 uint64_t *resultUint64;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3580 } _OrthancPluginReturnSingleValue;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3581
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3582 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3583 * @brief Get the number of command-line arguments.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3584 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3585 * Retrieve the number of command-line arguments that were used to launch Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3586 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3587 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3588 * @return The number of arguments.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3589 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3590 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetCommandLineArgumentsCount(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3591 OrthancPluginContext* context)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3592 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3593 uint32_t count = 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3594
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3595 _OrthancPluginReturnSingleValue params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3596 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3597 params.resultUint32 = &count;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3598
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3599 if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgumentsCount, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3600 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3601 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3602 return 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3603 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3604 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3605 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3606 return count;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3607 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3608 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3609
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3610
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3611
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3612 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3613 * @brief Get the value of a command-line argument.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3614 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3615 * Get the value of one of the command-line arguments that were used
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3616 * to launch Orthanc. The number of available arguments can be
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3617 * retrieved by OrthancPluginGetCommandLineArgumentsCount().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3618 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3619 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3620 * @param argument The index of the argument.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3621 * @return The value of the argument, or NULL in the case of an error. This
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3622 * string must be freed by OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3623 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3624 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetCommandLineArgument(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3625 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3626 uint32_t argument)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3627 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3628 char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3629
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3630 _OrthancPluginGlobalProperty params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3631 params.result = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3632 params.property = (int32_t) argument;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3633 params.value = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3634
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3635 if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgument, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3636 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3637 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3638 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3639 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3640 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3641 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3642 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3643 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3644 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3645
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3646
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3647 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3648 * @brief Get the expected version of the database schema.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3649 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3650 * Retrieve the expected version of the database schema.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3651 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3652 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3653 * @return The version.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3654 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3655 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3656 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetExpectedDatabaseVersion(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3657 OrthancPluginContext* context)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3658 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3659 uint32_t count = 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3660
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3661 _OrthancPluginReturnSingleValue params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3662 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3663 params.resultUint32 = &count;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3664
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3665 if (context->InvokeService(context, _OrthancPluginService_GetExpectedDatabaseVersion, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3666 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3667 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3668 return 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3669 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3670 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3671 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3672 return count;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3673 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3674 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3675
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3676
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3677
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3678 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3679 * @brief Return the content of the configuration file(s).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3680 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3681 * This function returns the content of the configuration that is
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3682 * used by Orthanc, formatted as a JSON string.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3683 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3684 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3685 * @return NULL in the case of an error, or a newly allocated string
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3686 * containing the configuration. This string must be freed by
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3687 * OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3688 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3689 ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfiguration(OrthancPluginContext* context)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3690 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3691 char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3692
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3693 _OrthancPluginRetrieveDynamicString params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3694 params.result = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3695 params.argument = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3696
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3697 if (context->InvokeService(context, _OrthancPluginService_GetConfiguration, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3698 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3699 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3700 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3701 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3702 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3703 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3704 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3705 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3706 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3707
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3708
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3709
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3710 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3711 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3712 OrthancPluginRestOutput* output;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3713 const char* subType;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3714 const char* contentType;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3715 } _OrthancPluginStartMultipartAnswer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3716
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3717 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3718 * @brief Start an HTTP multipart answer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3719 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3720 * Initiates a HTTP multipart answer, as the result of a REST request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3721 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3722 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3723 * @param output The HTTP connection to the client application.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3724 * @param subType The sub-type of the multipart answer ("mixed" or "related").
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3725 * @param contentType The MIME type of the items in the multipart answer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3726 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3727 * @see OrthancPluginSendMultipartItem(), OrthancPluginSendMultipartItem2()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3728 * @ingroup REST
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3729 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3730 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStartMultipartAnswer(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3731 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3732 OrthancPluginRestOutput* output,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3733 const char* subType,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3734 const char* contentType)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3735 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3736 _OrthancPluginStartMultipartAnswer params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3737 params.output = output;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3738 params.subType = subType;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3739 params.contentType = contentType;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3740 return context->InvokeService(context, _OrthancPluginService_StartMultipartAnswer, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3741 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3742
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3743
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3744 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3745 * @brief Send an item as a part of some HTTP multipart answer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3746 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3747 * This function sends an item as a part of some HTTP multipart
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3748 * answer that was initiated by OrthancPluginStartMultipartAnswer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3749 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3750 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3751 * @param output The HTTP connection to the client application.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3752 * @param answer Pointer to the memory buffer containing the item.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3753 * @param answerSize Number of bytes of the item.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3754 * @return 0 if success, or the error code if failure (this notably happens
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3755 * if the connection is closed by the client).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3756 * @see OrthancPluginSendMultipartItem2()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3757 * @ingroup REST
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3758 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3759 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3760 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3761 OrthancPluginRestOutput* output,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3762 const void* answer,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3763 uint32_t answerSize)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3764 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3765 _OrthancPluginAnswerBuffer params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3766 params.output = output;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3767 params.answer = answer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3768 params.answerSize = answerSize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3769 params.mimeType = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3770 return context->InvokeService(context, _OrthancPluginService_SendMultipartItem, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3771 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3772
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3773
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3774
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3775 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3776 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3777 OrthancPluginMemoryBuffer* target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3778 const void* source;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3779 uint32_t size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3780 OrthancPluginCompressionType compression;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3781 uint8_t uncompress;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3782 } _OrthancPluginBufferCompression;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3783
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3784
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3785 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3786 * @brief Compress or decompress a buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3787 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3788 * This function compresses or decompresses a buffer, using the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3789 * version of the zlib library that is used by the Orthanc core.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3790 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3791 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3792 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3793 * @param source The source buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3794 * @param size The size in bytes of the source buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3795 * @param compression The compression algorithm.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3796 * @param uncompress If set to "0", the buffer must be compressed.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3797 * If set to "1", the buffer must be uncompressed.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3798 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3799 * @ingroup Images
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3800 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3801 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginBufferCompression(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3802 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3803 OrthancPluginMemoryBuffer* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3804 const void* source,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3805 uint32_t size,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3806 OrthancPluginCompressionType compression,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3807 uint8_t uncompress)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3808 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3809 _OrthancPluginBufferCompression params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3810 params.target = target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3811 params.source = source;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3812 params.size = size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3813 params.compression = compression;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3814 params.uncompress = uncompress;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3815
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3816 return context->InvokeService(context, _OrthancPluginService_BufferCompression, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3817 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3818
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3819
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3820
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3821 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3822 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3823 OrthancPluginMemoryBuffer* target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3824 const char* path;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3825 } _OrthancPluginReadFile;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3826
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3827 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3828 * @brief Read a file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3829 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3830 * Read the content of a file on the filesystem, and returns it into
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3831 * a newly allocated memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3832 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3833 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3834 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3835 * @param path The path of the file to be read.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3836 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3837 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3838 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReadFile(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3839 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3840 OrthancPluginMemoryBuffer* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3841 const char* path)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3842 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3843 _OrthancPluginReadFile params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3844 params.target = target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3845 params.path = path;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3846 return context->InvokeService(context, _OrthancPluginService_ReadFile, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3847 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3848
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3849
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3850
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3851 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3852 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3853 const char* path;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3854 const void* data;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3855 uint32_t size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3856 } _OrthancPluginWriteFile;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3857
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3858 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3859 * @brief Write a file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3860 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3861 * Write the content of a memory buffer to the filesystem.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3862 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3863 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3864 * @param path The path of the file to be written.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3865 * @param data The content of the memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3866 * @param size The size of the memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3867 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3868 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3869 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWriteFile(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3870 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3871 const char* path,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3872 const void* data,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3873 uint32_t size)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3874 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3875 _OrthancPluginWriteFile params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3876 params.path = path;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3877 params.data = data;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3878 params.size = size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3879 return context->InvokeService(context, _OrthancPluginService_WriteFile, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3880 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3881
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3882
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3883
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3884 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3885 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3886 const char** target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3887 OrthancPluginErrorCode error;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3888 } _OrthancPluginGetErrorDescription;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3889
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3890 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3891 * @brief Get the description of a given error code.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3892 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3893 * This function returns the description of a given error code.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3894 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3895 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3896 * @param error The error code of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3897 * @return The error description. This is a statically-allocated
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3898 * string, do not free it.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3899 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3900 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetErrorDescription(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3901 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3902 OrthancPluginErrorCode error)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3903 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3904 const char* result = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3905
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3906 _OrthancPluginGetErrorDescription params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3907 params.target = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3908 params.error = error;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3909
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3910 if (context->InvokeService(context, _OrthancPluginService_GetErrorDescription, &params) != OrthancPluginErrorCode_Success ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3911 result == NULL)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3912 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3913 return "Unknown error code";
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3914 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3915 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3916 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3917 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3918 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3919 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3920
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3921
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3922
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3923 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3924 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3925 OrthancPluginRestOutput* output;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3926 uint16_t status;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3927 const void* body;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3928 uint32_t bodySize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3929 } _OrthancPluginSendHttpStatus;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3930
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3931 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3932 * @brief Send a HTTP status, with a custom body.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3933 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3934 * This function answers to a HTTP request by sending a HTTP status
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3935 * code (such as "400 - Bad Request"), together with a body
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3936 * describing the error. The body will only be returned if the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3937 * configuration option "HttpDescribeErrors" of Orthanc is set to "true".
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3938 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3939 * Note that:
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3940 * - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3941 * - Redirections (status 301) must use ::OrthancPluginRedirect().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3942 * - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3943 * - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3944 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3945 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3946 * @param output The HTTP connection to the client application.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3947 * @param status The HTTP status code to be sent.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3948 * @param body The body of the answer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3949 * @param bodySize The size of the body.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3950 * @see OrthancPluginSendHttpStatusCode()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3951 * @ingroup REST
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3952 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3953 ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatus(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3954 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3955 OrthancPluginRestOutput* output,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3956 uint16_t status,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3957 const void* body,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3958 uint32_t bodySize)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3959 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3960 _OrthancPluginSendHttpStatus params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3961 params.output = output;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3962 params.status = status;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3963 params.body = body;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3964 params.bodySize = bodySize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3965 context->InvokeService(context, _OrthancPluginService_SendHttpStatus, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3966 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3967
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3968
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3969
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3970 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3971 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3972 const OrthancPluginImage* image;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3973 uint32_t* resultUint32;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3974 OrthancPluginPixelFormat* resultPixelFormat;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3975 void** resultBuffer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3976 } _OrthancPluginGetImageInfo;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3977
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3978
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3979 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3980 * @brief Return the pixel format of an image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3981 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3982 * This function returns the type of memory layout for the pixels of the given image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3983 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3984 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3985 * @param image The image of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3986 * @return The pixel format.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3987 * @ingroup Images
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3988 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3989 ORTHANC_PLUGIN_INLINE OrthancPluginPixelFormat OrthancPluginGetImagePixelFormat(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3990 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3991 const OrthancPluginImage* image)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3992 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3993 OrthancPluginPixelFormat target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3994
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3995 _OrthancPluginGetImageInfo params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3996 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3997 params.image = image;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3998 params.resultPixelFormat = &target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3999
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4000 if (context->InvokeService(context, _OrthancPluginService_GetImagePixelFormat, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4001 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4002 return OrthancPluginPixelFormat_Unknown;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4003 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4004 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4005 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4006 return (OrthancPluginPixelFormat) target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4007 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4008 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4009
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4010
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4011
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4012 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4013 * @brief Return the width of an image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4014 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4015 * This function returns the width of the given image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4016 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4017 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4018 * @param image The image of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4019 * @return The width.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4020 * @ingroup Images
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4021 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4022 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageWidth(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4023 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4024 const OrthancPluginImage* image)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4025 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4026 uint32_t width;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4027
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4028 _OrthancPluginGetImageInfo params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4029 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4030 params.image = image;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4031 params.resultUint32 = &width;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4032
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4033 if (context->InvokeService(context, _OrthancPluginService_GetImageWidth, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4034 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4035 return 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4036 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4037 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4038 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4039 return width;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4040 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4041 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4042
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4043
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4044
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4045 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4046 * @brief Return the height of an image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4047 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4048 * This function returns the height of the given image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4049 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4050 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4051 * @param image The image of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4052 * @return The height.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4053 * @ingroup Images
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4054 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4055 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImageHeight(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4056 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4057 const OrthancPluginImage* image)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4058 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4059 uint32_t height;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4060
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4061 _OrthancPluginGetImageInfo params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4062 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4063 params.image = image;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4064 params.resultUint32 = &height;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4065
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4066 if (context->InvokeService(context, _OrthancPluginService_GetImageHeight, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4067 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4068 return 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4069 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4070 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4071 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4072 return height;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4073 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4074 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4075
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4076
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4077
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4078 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4079 * @brief Return the pitch of an image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4080 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4081 * This function returns the pitch of the given image. The pitch is
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4082 * defined as the number of bytes between 2 successive lines of the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4083 * image in the memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4084 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4085 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4086 * @param image The image of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4087 * @return The pitch.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4088 * @ingroup Images
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4089 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4090 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetImagePitch(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4091 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4092 const OrthancPluginImage* image)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4093 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4094 uint32_t pitch;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4095
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4096 _OrthancPluginGetImageInfo params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4097 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4098 params.image = image;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4099 params.resultUint32 = &pitch;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4100
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4101 if (context->InvokeService(context, _OrthancPluginService_GetImagePitch, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4102 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4103 return 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4104 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4105 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4106 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4107 return pitch;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4108 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4109 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4110
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4111
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4112
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4113 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4114 * @brief Return a pointer to the content of an image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4115 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4116 * This function returns a pointer to the memory buffer that
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4117 * contains the pixels of the image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4118 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4119 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4120 * @param image The image of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4121 * @return The pointer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4122 * @ingroup Images
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4123 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4124 ORTHANC_PLUGIN_INLINE void* OrthancPluginGetImageBuffer(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4125 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4126 const OrthancPluginImage* image)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4127 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4128 void* target = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4129
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4130 _OrthancPluginGetImageInfo params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4131 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4132 params.resultBuffer = &target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4133 params.image = image;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4134
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4135 if (context->InvokeService(context, _OrthancPluginService_GetImageBuffer, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4136 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4137 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4138 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4139 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4140 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4141 return target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4142 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4143 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4144
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4145
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4146 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4147 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4148 OrthancPluginImage** target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4149 const void* data;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4150 uint32_t size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4151 OrthancPluginImageFormat format;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4152 } _OrthancPluginUncompressImage;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4153
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4154
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4155 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4156 * @brief Decode a compressed image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4157 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4158 * This function decodes a compressed image from a memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4159 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4160 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4161 * @param data Pointer to a memory buffer containing the compressed image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4162 * @param size Size of the memory buffer containing the compressed image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4163 * @param format The file format of the compressed image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4164 * @return The uncompressed image. It must be freed with OrthancPluginFreeImage().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4165 * @ingroup Images
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4166 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4167 ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginUncompressImage(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4168 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4169 const void* data,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4170 uint32_t size,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4171 OrthancPluginImageFormat format)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4172 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4173 OrthancPluginImage* target = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4174
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4175 _OrthancPluginUncompressImage params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4176 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4177 params.target = &target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4178 params.data = data;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4179 params.size = size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4180 params.format = format;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4181
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4182 if (context->InvokeService(context, _OrthancPluginService_UncompressImage, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4183 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4184 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4185 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4186 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4187 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4188 return target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4189 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4190 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4191
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4192
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4193
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4194
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4195 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4196 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4197 OrthancPluginImage* image;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4198 } _OrthancPluginFreeImage;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4199
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4200 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4201 * @brief Free an image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4202 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4203 * This function frees an image that was decoded with OrthancPluginUncompressImage().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4204 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4205 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4206 * @param image The image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4207 * @ingroup Images
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4208 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4209 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeImage(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4210 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4211 OrthancPluginImage* image)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4212 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4213 _OrthancPluginFreeImage params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4214 params.image = image;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4215
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4216 context->InvokeService(context, _OrthancPluginService_FreeImage, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4217 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4218
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4219
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4220
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4221
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4222 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4223 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4224 OrthancPluginMemoryBuffer* target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4225 OrthancPluginImageFormat imageFormat;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4226 OrthancPluginPixelFormat pixelFormat;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4227 uint32_t width;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4228 uint32_t height;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4229 uint32_t pitch;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4230 const void* buffer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4231 uint8_t quality;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4232 } _OrthancPluginCompressImage;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4233
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4234
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4235 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4236 * @brief Encode a PNG image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4237 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4238 * This function compresses the given memory buffer containing an
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4239 * image using the PNG specification, and stores the result of the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4240 * compression into a newly allocated memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4241 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4242 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4243 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4244 * @param format The memory layout of the uncompressed image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4245 * @param width The width of the image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4246 * @param height The height of the image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4247 * @param pitch The pitch of the image (i.e. the number of bytes
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4248 * between 2 successive lines of the image in the memory buffer).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4249 * @param buffer The memory buffer containing the uncompressed image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4250 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4251 * @see OrthancPluginCompressAndAnswerPngImage()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4252 * @ingroup Images
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4253 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4254 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressPngImage(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4255 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4256 OrthancPluginMemoryBuffer* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4257 OrthancPluginPixelFormat format,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4258 uint32_t width,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4259 uint32_t height,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4260 uint32_t pitch,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4261 const void* buffer)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4262 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4263 _OrthancPluginCompressImage params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4264 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4265 params.target = target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4266 params.imageFormat = OrthancPluginImageFormat_Png;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4267 params.pixelFormat = format;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4268 params.width = width;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4269 params.height = height;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4270 params.pitch = pitch;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4271 params.buffer = buffer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4272 params.quality = 0; /* Unused for PNG */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4273
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4274 return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4275 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4276
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4277
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4278 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4279 * @brief Encode a JPEG image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4280 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4281 * This function compresses the given memory buffer containing an
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4282 * image using the JPEG specification, and stores the result of the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4283 * compression into a newly allocated memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4284 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4285 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4286 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4287 * @param format The memory layout of the uncompressed image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4288 * @param width The width of the image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4289 * @param height The height of the image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4290 * @param pitch The pitch of the image (i.e. the number of bytes
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4291 * between 2 successive lines of the image in the memory buffer).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4292 * @param buffer The memory buffer containing the uncompressed image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4293 * @param quality The quality of the JPEG encoding, between 1 (worst
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4294 * quality, best compression) and 100 (best quality, worst
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4295 * compression).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4296 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4297 * @ingroup Images
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4298 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4299 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressJpegImage(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4300 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4301 OrthancPluginMemoryBuffer* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4302 OrthancPluginPixelFormat format,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4303 uint32_t width,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4304 uint32_t height,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4305 uint32_t pitch,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4306 const void* buffer,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4307 uint8_t quality)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4308 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4309 _OrthancPluginCompressImage params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4310 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4311 params.target = target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4312 params.imageFormat = OrthancPluginImageFormat_Jpeg;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4313 params.pixelFormat = format;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4314 params.width = width;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4315 params.height = height;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4316 params.pitch = pitch;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4317 params.buffer = buffer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4318 params.quality = quality;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4319
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4320 return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4321 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4322
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4323
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4324
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4325 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4326 * @brief Answer to a REST request with a JPEG image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4327 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4328 * This function answers to a REST request with a JPEG image. The
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4329 * parameters of this function describe a memory buffer that
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4330 * contains an uncompressed image. The image will be automatically compressed
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4331 * as a JPEG image by the core system of Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4332 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4333 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4334 * @param output The HTTP connection to the client application.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4335 * @param format The memory layout of the uncompressed image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4336 * @param width The width of the image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4337 * @param height The height of the image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4338 * @param pitch The pitch of the image (i.e. the number of bytes
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4339 * between 2 successive lines of the image in the memory buffer).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4340 * @param buffer The memory buffer containing the uncompressed image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4341 * @param quality The quality of the JPEG encoding, between 1 (worst
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4342 * quality, best compression) and 100 (best quality, worst
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4343 * compression).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4344 * @ingroup REST
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4345 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4346 ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerJpegImage(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4347 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4348 OrthancPluginRestOutput* output,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4349 OrthancPluginPixelFormat format,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4350 uint32_t width,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4351 uint32_t height,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4352 uint32_t pitch,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4353 const void* buffer,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4354 uint8_t quality)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4355 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4356 _OrthancPluginCompressAndAnswerImage params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4357 params.output = output;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4358 params.imageFormat = OrthancPluginImageFormat_Jpeg;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4359 params.pixelFormat = format;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4360 params.width = width;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4361 params.height = height;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4362 params.pitch = pitch;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4363 params.buffer = buffer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4364 params.quality = quality;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4365 context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4366 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4367
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4368
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4369
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4370
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4371 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4372 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4373 OrthancPluginMemoryBuffer* target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4374 OrthancPluginHttpMethod method;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4375 const char* url;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4376 const char* username;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4377 const char* password;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4378 const void* body;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4379 uint32_t bodySize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4380 } _OrthancPluginCallHttpClient;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4381
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4382
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4383 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4384 * @brief Issue a HTTP GET call.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4385 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4386 * Make a HTTP GET call to the given URL. The result to the query is
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4387 * stored into a newly allocated memory buffer. Favor
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4388 * OrthancPluginRestApiGet() if calling the built-in REST API of the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4389 * Orthanc instance that hosts this plugin.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4390 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4391 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4392 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4393 * @param url The URL of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4394 * @param username The username (can be <tt>NULL</tt> if no password protection).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4395 * @param password The password (can be <tt>NULL</tt> if no password protection).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4396 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4397 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4398 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4399 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpGet(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4400 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4401 OrthancPluginMemoryBuffer* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4402 const char* url,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4403 const char* username,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4404 const char* password)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4405 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4406 _OrthancPluginCallHttpClient params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4407 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4408
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4409 params.target = target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4410 params.method = OrthancPluginHttpMethod_Get;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4411 params.url = url;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4412 params.username = username;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4413 params.password = password;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4414
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4415 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4416 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4417
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4418
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4419 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4420 * @brief Issue a HTTP POST call.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4421 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4422 * Make a HTTP POST call to the given URL. The result to the query
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4423 * is stored into a newly allocated memory buffer. Favor
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4424 * OrthancPluginRestApiPost() if calling the built-in REST API of
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4425 * the Orthanc instance that hosts this plugin.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4426 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4427 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4428 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4429 * @param url The URL of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4430 * @param body The content of the body of the request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4431 * @param bodySize The size of the body of the request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4432 * @param username The username (can be <tt>NULL</tt> if no password protection).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4433 * @param password The password (can be <tt>NULL</tt> if no password protection).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4434 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4435 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4436 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4437 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPost(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4438 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4439 OrthancPluginMemoryBuffer* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4440 const char* url,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4441 const void* body,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4442 uint32_t bodySize,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4443 const char* username,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4444 const char* password)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4445 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4446 _OrthancPluginCallHttpClient params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4447 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4448
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4449 params.target = target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4450 params.method = OrthancPluginHttpMethod_Post;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4451 params.url = url;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4452 params.body = body;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4453 params.bodySize = bodySize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4454 params.username = username;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4455 params.password = password;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4456
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4457 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4458 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4459
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4460
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4461 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4462 * @brief Issue a HTTP PUT call.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4463 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4464 * Make a HTTP PUT call to the given URL. The result to the query is
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4465 * stored into a newly allocated memory buffer. Favor
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4466 * OrthancPluginRestApiPut() if calling the built-in REST API of the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4467 * Orthanc instance that hosts this plugin.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4468 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4469 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4470 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4471 * @param url The URL of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4472 * @param body The content of the body of the request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4473 * @param bodySize The size of the body of the request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4474 * @param username The username (can be <tt>NULL</tt> if no password protection).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4475 * @param password The password (can be <tt>NULL</tt> if no password protection).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4476 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4477 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4478 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4479 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpPut(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4480 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4481 OrthancPluginMemoryBuffer* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4482 const char* url,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4483 const void* body,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4484 uint32_t bodySize,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4485 const char* username,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4486 const char* password)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4487 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4488 _OrthancPluginCallHttpClient params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4489 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4490
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4491 params.target = target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4492 params.method = OrthancPluginHttpMethod_Put;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4493 params.url = url;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4494 params.body = body;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4495 params.bodySize = bodySize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4496 params.username = username;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4497 params.password = password;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4498
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4499 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4500 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4501
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4502
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4503 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4504 * @brief Issue a HTTP DELETE call.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4505 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4506 * Make a HTTP DELETE call to the given URL. Favor
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4507 * OrthancPluginRestApiDelete() if calling the built-in REST API of
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4508 * the Orthanc instance that hosts this plugin.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4509 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4510 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4511 * @param url The URL of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4512 * @param username The username (can be <tt>NULL</tt> if no password protection).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4513 * @param password The password (can be <tt>NULL</tt> if no password protection).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4514 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4515 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4516 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4517 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpDelete(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4518 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4519 const char* url,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4520 const char* username,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4521 const char* password)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4522 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4523 _OrthancPluginCallHttpClient params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4524 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4525
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4526 params.method = OrthancPluginHttpMethod_Delete;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4527 params.url = url;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4528 params.username = username;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4529 params.password = password;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4530
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4531 return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4532 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4533
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4534
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4535
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4536 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4537 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4538 OrthancPluginImage** target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4539 const OrthancPluginImage* source;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4540 OrthancPluginPixelFormat targetFormat;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4541 } _OrthancPluginConvertPixelFormat;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4542
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4543
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4544 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4545 * @brief Change the pixel format of an image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4546 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4547 * This function creates a new image, changing the memory layout of the pixels.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4548 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4549 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4550 * @param source The source image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4551 * @param targetFormat The target pixel format.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4552 * @return The resulting image. It must be freed with OrthancPluginFreeImage().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4553 * @ingroup Images
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4554 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4555 ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginConvertPixelFormat(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4556 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4557 const OrthancPluginImage* source,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4558 OrthancPluginPixelFormat targetFormat)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4559 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4560 OrthancPluginImage* target = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4561
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4562 _OrthancPluginConvertPixelFormat params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4563 params.target = &target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4564 params.source = source;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4565 params.targetFormat = targetFormat;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4566
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4567 if (context->InvokeService(context, _OrthancPluginService_ConvertPixelFormat, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4568 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4569 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4570 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4571 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4572 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4573 return target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4574 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4575 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4576
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4577
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4578
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4579 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4580 * @brief Return the number of available fonts.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4581 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4582 * This function returns the number of fonts that are built in the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4583 * Orthanc core. These fonts can be used to draw texts on images
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4584 * through OrthancPluginDrawText().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4585 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4586 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4587 * @return The number of fonts.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4588 * @ingroup Images
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4589 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4590 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontsCount(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4591 OrthancPluginContext* context)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4592 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4593 uint32_t count = 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4594
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4595 _OrthancPluginReturnSingleValue params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4596 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4597 params.resultUint32 = &count;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4598
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4599 if (context->InvokeService(context, _OrthancPluginService_GetFontsCount, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4600 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4601 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4602 return 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4603 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4604 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4605 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4606 return count;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4607 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4608 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4609
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4610
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4611
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4612
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4613 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4614 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4615 uint32_t fontIndex; /* in */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4616 const char** name; /* out */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4617 uint32_t* size; /* out */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4618 } _OrthancPluginGetFontInfo;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4619
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4620 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4621 * @brief Return the name of a font.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4622 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4623 * This function returns the name of a font that is built in the Orthanc core.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4624 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4625 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4626 * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4627 * @return The font name. This is a statically-allocated string, do not free it.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4628 * @ingroup Images
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4629 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4630 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetFontName(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4631 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4632 uint32_t fontIndex)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4633 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4634 const char* result = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4635
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4636 _OrthancPluginGetFontInfo params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4637 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4638 params.name = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4639 params.fontIndex = fontIndex;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4640
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4641 if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4642 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4643 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4644 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4645 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4646 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4647 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4648 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4649 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4650
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4651
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4652 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4653 * @brief Return the size of a font.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4654 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4655 * This function returns the size of a font that is built in the Orthanc core.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4656 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4657 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4658 * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4659 * @return The font size.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4660 * @ingroup Images
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4661 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4662 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontSize(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4663 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4664 uint32_t fontIndex)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4665 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4666 uint32_t result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4667
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4668 _OrthancPluginGetFontInfo params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4669 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4670 params.size = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4671 params.fontIndex = fontIndex;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4672
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4673 if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4674 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4675 return 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4676 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4677 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4678 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4679 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4680 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4681 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4682
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4683
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4684
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4685 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4686 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4687 OrthancPluginImage* image;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4688 uint32_t fontIndex;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4689 const char* utf8Text;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4690 int32_t x;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4691 int32_t y;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4692 uint8_t r;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4693 uint8_t g;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4694 uint8_t b;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4695 } _OrthancPluginDrawText;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4696
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4697
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4698 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4699 * @brief Draw text on an image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4700 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4701 * This function draws some text on some image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4702 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4703 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4704 * @param image The image upon which to draw the text.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4705 * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4706 * @param utf8Text The text to be drawn, encoded as an UTF-8 zero-terminated string.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4707 * @param x The X position of the text over the image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4708 * @param y The Y position of the text over the image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4709 * @param r The value of the red color channel of the text.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4710 * @param g The value of the green color channel of the text.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4711 * @param b The value of the blue color channel of the text.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4712 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4713 * @ingroup Images
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4714 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4715 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginDrawText(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4716 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4717 OrthancPluginImage* image,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4718 uint32_t fontIndex,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4719 const char* utf8Text,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4720 int32_t x,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4721 int32_t y,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4722 uint8_t r,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4723 uint8_t g,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4724 uint8_t b)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4725 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4726 _OrthancPluginDrawText params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4727 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4728 params.image = image;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4729 params.fontIndex = fontIndex;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4730 params.utf8Text = utf8Text;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4731 params.x = x;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4732 params.y = y;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4733 params.r = r;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4734 params.g = g;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4735 params.b = b;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4736
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4737 return context->InvokeService(context, _OrthancPluginService_DrawText, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4738 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4739
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4740
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4741
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4742 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4743 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4744 OrthancPluginStorageArea* storageArea;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4745 const char* uuid;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4746 const void* content;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4747 uint64_t size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4748 OrthancPluginContentType type;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4749 } _OrthancPluginStorageAreaCreate;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4750
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4751
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4752 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4753 * @brief Create a file inside the storage area.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4754 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4755 * This function creates a new file inside the storage area that is
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4756 * currently used by Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4757 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4758 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4759 * @param storageArea The storage area.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4760 * @param uuid The identifier of the file to be created.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4761 * @param content The content to store in the newly created file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4762 * @param size The size of the content.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4763 * @param type The type of the file content.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4764 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4765 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4766 * @deprecated This function should not be used anymore. Use "OrthancPluginRestApiPut()" on
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4767 * "/{patients|studies|series|instances}/{id}/attachments/{name}" instead.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4768 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4769 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaCreate(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4770 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4771 OrthancPluginStorageArea* storageArea,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4772 const char* uuid,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4773 const void* content,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4774 uint64_t size,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4775 OrthancPluginContentType type)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4776 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4777 _OrthancPluginStorageAreaCreate params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4778 params.storageArea = storageArea;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4779 params.uuid = uuid;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4780 params.content = content;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4781 params.size = size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4782 params.type = type;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4783
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4784 return context->InvokeService(context, _OrthancPluginService_StorageAreaCreate, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4785 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4786
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4787
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4788 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4789 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4790 OrthancPluginMemoryBuffer* target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4791 OrthancPluginStorageArea* storageArea;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4792 const char* uuid;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4793 OrthancPluginContentType type;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4794 } _OrthancPluginStorageAreaRead;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4795
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4796
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4797 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4798 * @brief Read a file from the storage area.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4799 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4800 * This function reads the content of a given file from the storage
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4801 * area that is currently used by Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4802 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4803 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4804 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4805 * @param storageArea The storage area.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4806 * @param uuid The identifier of the file to be read.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4807 * @param type The type of the file content.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4808 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4809 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4810 * @deprecated This function should not be used anymore. Use "OrthancPluginRestApiGet()" on
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4811 * "/{patients|studies|series|instances}/{id}/attachments/{name}" instead.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4812 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4813 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRead(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4814 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4815 OrthancPluginMemoryBuffer* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4816 OrthancPluginStorageArea* storageArea,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4817 const char* uuid,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4818 OrthancPluginContentType type)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4819 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4820 _OrthancPluginStorageAreaRead params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4821 params.target = target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4822 params.storageArea = storageArea;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4823 params.uuid = uuid;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4824 params.type = type;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4825
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4826 return context->InvokeService(context, _OrthancPluginService_StorageAreaRead, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4827 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4828
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4829
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4830 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4831 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4832 OrthancPluginStorageArea* storageArea;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4833 const char* uuid;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4834 OrthancPluginContentType type;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4835 } _OrthancPluginStorageAreaRemove;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4836
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4837 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4838 * @brief Remove a file from the storage area.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4839 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4840 * This function removes a given file from the storage area that is
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4841 * currently used by Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4842 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4843 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4844 * @param storageArea The storage area.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4845 * @param uuid The identifier of the file to be removed.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4846 * @param type The type of the file content.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4847 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4848 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4849 * @deprecated This function should not be used anymore. Use "OrthancPluginRestApiDelete()" on
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4850 * "/{patients|studies|series|instances}/{id}/attachments/{name}" instead.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4851 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4852 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStorageAreaRemove(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4853 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4854 OrthancPluginStorageArea* storageArea,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4855 const char* uuid,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4856 OrthancPluginContentType type)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4857 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4858 _OrthancPluginStorageAreaRemove params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4859 params.storageArea = storageArea;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4860 params.uuid = uuid;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4861 params.type = type;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4862
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4863 return context->InvokeService(context, _OrthancPluginService_StorageAreaRemove, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4864 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4865
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4866
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4867
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4868 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4869 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4870 OrthancPluginErrorCode* target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4871 int32_t code;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4872 uint16_t httpStatus;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4873 const char* message;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4874 } _OrthancPluginRegisterErrorCode;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4875
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4876 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4877 * @brief Declare a custom error code for this plugin.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4878 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4879 * This function declares a custom error code that can be generated
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4880 * by this plugin. This declaration is used to enrich the body of
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4881 * the HTTP answer in the case of an error, and to set the proper
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4882 * HTTP status code.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4883 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4884 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4885 * @param code The error code that is internal to this plugin.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4886 * @param httpStatus The HTTP status corresponding to this error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4887 * @param message The description of the error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4888 * @return The error code that has been assigned inside the Orthanc core.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4889 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4890 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4891 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterErrorCode(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4892 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4893 int32_t code,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4894 uint16_t httpStatus,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4895 const char* message)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4896 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4897 OrthancPluginErrorCode target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4898
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4899 _OrthancPluginRegisterErrorCode params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4900 params.target = &target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4901 params.code = code;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4902 params.httpStatus = httpStatus;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4903 params.message = message;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4904
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4905 if (context->InvokeService(context, _OrthancPluginService_RegisterErrorCode, &params) == OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4906 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4907 return target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4908 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4909 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4910 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4911 /* There was an error while assigned the error. Use a generic code. */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4912 return OrthancPluginErrorCode_Plugin;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4913 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4914 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4915
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4916
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4917
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4918 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4919 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4920 uint16_t group;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4921 uint16_t element;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4922 OrthancPluginValueRepresentation vr;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4923 const char* name;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4924 uint32_t minMultiplicity;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4925 uint32_t maxMultiplicity;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4926 } _OrthancPluginRegisterDictionaryTag;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4927
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4928 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4929 * @brief Register a new tag into the DICOM dictionary.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4930 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4931 * This function declares a new public tag in the dictionary of
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4932 * DICOM tags that are known to Orthanc. This function should be
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4933 * used in the OrthancPluginInitialize() callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4934 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4935 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4936 * @param group The group of the tag.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4937 * @param element The element of the tag.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4938 * @param vr The value representation of the tag.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4939 * @param name The nickname of the tag.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4940 * @param minMultiplicity The minimum multiplicity of the tag (must be above 0).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4941 * @param maxMultiplicity The maximum multiplicity of the tag. A value of 0 means
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4942 * an arbitrary multiplicity ("<tt>n</tt>").
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4943 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4944 * @see OrthancPluginRegisterPrivateDictionaryTag()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4945 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4946 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4947 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDictionaryTag(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4948 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4949 uint16_t group,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4950 uint16_t element,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4951 OrthancPluginValueRepresentation vr,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4952 const char* name,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4953 uint32_t minMultiplicity,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4954 uint32_t maxMultiplicity)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4955 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4956 _OrthancPluginRegisterDictionaryTag params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4957 params.group = group;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4958 params.element = element;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4959 params.vr = vr;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4960 params.name = name;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4961 params.minMultiplicity = minMultiplicity;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4962 params.maxMultiplicity = maxMultiplicity;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4963
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4964 return context->InvokeService(context, _OrthancPluginService_RegisterDictionaryTag, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4965 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4966
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4967
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4968
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4969 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4970 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4971 uint16_t group;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4972 uint16_t element;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4973 OrthancPluginValueRepresentation vr;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4974 const char* name;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4975 uint32_t minMultiplicity;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4976 uint32_t maxMultiplicity;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4977 const char* privateCreator;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4978 } _OrthancPluginRegisterPrivateDictionaryTag;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4979
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4980 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4981 * @brief Register a new private tag into the DICOM dictionary.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4982 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4983 * This function declares a new private tag in the dictionary of
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4984 * DICOM tags that are known to Orthanc. This function should be
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4985 * used in the OrthancPluginInitialize() callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4986 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4987 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4988 * @param group The group of the tag.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4989 * @param element The element of the tag.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4990 * @param vr The value representation of the tag.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4991 * @param name The nickname of the tag.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4992 * @param minMultiplicity The minimum multiplicity of the tag (must be above 0).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4993 * @param maxMultiplicity The maximum multiplicity of the tag. A value of 0 means
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4994 * an arbitrary multiplicity ("<tt>n</tt>").
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4995 * @param privateCreator The private creator of this private tag.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4996 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4997 * @see OrthancPluginRegisterDictionaryTag()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4998 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4999 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5000 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterPrivateDictionaryTag(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5001 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5002 uint16_t group,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5003 uint16_t element,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5004 OrthancPluginValueRepresentation vr,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5005 const char* name,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5006 uint32_t minMultiplicity,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5007 uint32_t maxMultiplicity,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5008 const char* privateCreator)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5009 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5010 _OrthancPluginRegisterPrivateDictionaryTag params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5011 params.group = group;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5012 params.element = element;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5013 params.vr = vr;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5014 params.name = name;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5015 params.minMultiplicity = minMultiplicity;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5016 params.maxMultiplicity = maxMultiplicity;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5017 params.privateCreator = privateCreator;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5018
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5019 return context->InvokeService(context, _OrthancPluginService_RegisterPrivateDictionaryTag, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5020 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5021
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5022
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5023
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5024 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5025 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5026 OrthancPluginStorageArea* storageArea;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5027 OrthancPluginResourceType level;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5028 } _OrthancPluginReconstructMainDicomTags;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5029
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5030 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5031 * @brief Reconstruct the main DICOM tags.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5032 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5033 * This function requests the Orthanc core to reconstruct the main
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5034 * DICOM tags of all the resources of the given type. This function
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5035 * can only be used as a part of the upgrade of a custom database
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5036 * back-end. A database transaction will be automatically setup.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5037 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5038 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5039 * @param storageArea The storage area.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5040 * @param level The type of the resources of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5041 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5042 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5043 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5044 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginReconstructMainDicomTags(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5045 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5046 OrthancPluginStorageArea* storageArea,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5047 OrthancPluginResourceType level)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5048 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5049 _OrthancPluginReconstructMainDicomTags params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5050 params.level = level;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5051 params.storageArea = storageArea;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5052
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5053 return context->InvokeService(context, _OrthancPluginService_ReconstructMainDicomTags, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5054 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5055
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5056
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5057 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5058 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5059 char** result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5060 const char* instanceId;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5061 const void* buffer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5062 uint32_t size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5063 OrthancPluginDicomToJsonFormat format;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5064 OrthancPluginDicomToJsonFlags flags;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5065 uint32_t maxStringLength;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5066 } _OrthancPluginDicomToJson;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5067
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5068
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5069 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5070 * @brief Format a DICOM memory buffer as a JSON string.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5071 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5072 * This function takes as input a memory buffer containing a DICOM
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5073 * file, and outputs a JSON string representing the tags of this
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5074 * DICOM file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5075 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5076 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5077 * @param buffer The memory buffer containing the DICOM file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5078 * @param size The size of the memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5079 * @param format The output format.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5080 * @param flags Flags governing the output.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5081 * @param maxStringLength The maximum length of a field. Too long fields will
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5082 * be output as "null". The 0 value means no maximum length.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5083 * @return The NULL value if the case of an error, or the JSON
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5084 * string. This string must be freed by OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5085 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5086 * @see OrthancPluginDicomInstanceToJson()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5087 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5088 ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomBufferToJson(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5089 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5090 const void* buffer,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5091 uint32_t size,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5092 OrthancPluginDicomToJsonFormat format,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5093 OrthancPluginDicomToJsonFlags flags,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5094 uint32_t maxStringLength)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5095 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5096 char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5097
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5098 _OrthancPluginDicomToJson params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5099 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5100 params.result = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5101 params.buffer = buffer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5102 params.size = size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5103 params.format = format;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5104 params.flags = flags;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5105 params.maxStringLength = maxStringLength;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5106
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5107 if (context->InvokeService(context, _OrthancPluginService_DicomBufferToJson, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5108 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5109 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5110 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5111 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5112 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5113 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5114 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5115 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5116 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5117
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5118
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5119 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5120 * @brief Format a DICOM instance as a JSON string.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5121 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5122 * This function formats a DICOM instance that is stored in Orthanc,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5123 * and outputs a JSON string representing the tags of this DICOM
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5124 * instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5125 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5126 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5127 * @param instanceId The Orthanc identifier of the instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5128 * @param format The output format.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5129 * @param flags Flags governing the output.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5130 * @param maxStringLength The maximum length of a field. Too long fields will
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5131 * be output as "null". The 0 value means no maximum length.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5132 * @return The NULL value if the case of an error, or the JSON
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5133 * string. This string must be freed by OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5134 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5135 * @see OrthancPluginDicomInstanceToJson()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5136 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5137 ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomInstanceToJson(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5138 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5139 const char* instanceId,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5140 OrthancPluginDicomToJsonFormat format,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5141 OrthancPluginDicomToJsonFlags flags,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5142 uint32_t maxStringLength)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5143 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5144 char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5145
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5146 _OrthancPluginDicomToJson params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5147 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5148 params.result = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5149 params.instanceId = instanceId;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5150 params.format = format;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5151 params.flags = flags;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5152 params.maxStringLength = maxStringLength;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5153
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5154 if (context->InvokeService(context, _OrthancPluginService_DicomInstanceToJson, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5155 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5156 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5157 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5158 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5159 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5160 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5161 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5162 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5163 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5164
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5165
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5166 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5167 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5168 OrthancPluginMemoryBuffer* target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5169 const char* uri;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5170 uint32_t headersCount;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5171 const char* const* headersKeys;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5172 const char* const* headersValues;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5173 int32_t afterPlugins;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5174 } _OrthancPluginRestApiGet2;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5175
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5176 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5177 * @brief Make a GET call to the Orthanc REST API, with custom HTTP headers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5178 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5179 * Make a GET call to the Orthanc REST API with extended
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5180 * parameters. The result to the query is stored into a newly
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5181 * allocated memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5182 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5183 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5184 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5185 * @param uri The URI in the built-in Orthanc API.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5186 * @param headersCount The number of HTTP headers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5187 * @param headersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5188 * @param headersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5189 * @param afterPlugins If 0, the built-in API of Orthanc is used.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5190 * If 1, the API is tainted by the plugins.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5191 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5192 * @see OrthancPluginRestApiGet(), OrthancPluginRestApiGetAfterPlugins()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5193 * @ingroup Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5194 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5195 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRestApiGet2(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5196 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5197 OrthancPluginMemoryBuffer* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5198 const char* uri,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5199 uint32_t headersCount,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5200 const char* const* headersKeys,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5201 const char* const* headersValues,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5202 int32_t afterPlugins)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5203 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5204 _OrthancPluginRestApiGet2 params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5205 params.target = target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5206 params.uri = uri;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5207 params.headersCount = headersCount;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5208 params.headersKeys = headersKeys;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5209 params.headersValues = headersValues;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5210 params.afterPlugins = afterPlugins;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5211
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5212 return context->InvokeService(context, _OrthancPluginService_RestApiGet2, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5213 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5214
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5215
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5216
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5217 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5218 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5219 OrthancPluginWorklistCallback callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5220 } _OrthancPluginWorklistCallback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5221
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5222 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5223 * @brief Register a callback to handle modality worklists requests.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5224 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5225 * This function registers a callback to handle C-Find SCP requests
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5226 * on modality worklists.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5227 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5228 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5229 * @param callback The callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5230 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5231 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5232 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5233 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterWorklistCallback(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5234 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5235 OrthancPluginWorklistCallback callback)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5236 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5237 _OrthancPluginWorklistCallback params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5238 params.callback = callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5239
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5240 return context->InvokeService(context, _OrthancPluginService_RegisterWorklistCallback, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5241 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5242
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5243
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5244
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5245 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5246 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5247 OrthancPluginWorklistAnswers* answers;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5248 const OrthancPluginWorklistQuery* query;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5249 const void* dicom;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5250 uint32_t size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5251 } _OrthancPluginWorklistAnswersOperation;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5252
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5253 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5254 * @brief Add one answer to some modality worklist request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5255 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5256 * This function adds one worklist (encoded as a DICOM file) to the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5257 * set of answers corresponding to some C-Find SCP request against
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5258 * modality worklists.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5259 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5260 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5261 * @param answers The set of answers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5262 * @param query The worklist query, as received by the callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5263 * @param dicom The worklist to answer, encoded as a DICOM file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5264 * @param size The size of the DICOM file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5265 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5266 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5267 * @see OrthancPluginCreateDicom()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5268 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5269 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistAddAnswer(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5270 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5271 OrthancPluginWorklistAnswers* answers,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5272 const OrthancPluginWorklistQuery* query,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5273 const void* dicom,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5274 uint32_t size)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5275 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5276 _OrthancPluginWorklistAnswersOperation params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5277 params.answers = answers;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5278 params.query = query;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5279 params.dicom = dicom;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5280 params.size = size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5281
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5282 return context->InvokeService(context, _OrthancPluginService_WorklistAddAnswer, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5283 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5284
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5285
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5286 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5287 * @brief Mark the set of worklist answers as incomplete.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5288 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5289 * This function marks as incomplete the set of answers
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5290 * corresponding to some C-Find SCP request against modality
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5291 * worklists. This must be used if canceling the handling of a
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5292 * request when too many answers are to be returned.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5293 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5294 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5295 * @param answers The set of answers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5296 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5297 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5298 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5299 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistMarkIncomplete(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5300 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5301 OrthancPluginWorklistAnswers* answers)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5302 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5303 _OrthancPluginWorklistAnswersOperation params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5304 params.answers = answers;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5305 params.query = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5306 params.dicom = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5307 params.size = 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5308
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5309 return context->InvokeService(context, _OrthancPluginService_WorklistMarkIncomplete, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5310 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5311
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5312
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5313 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5314 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5315 const OrthancPluginWorklistQuery* query;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5316 const void* dicom;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5317 uint32_t size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5318 int32_t* isMatch;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5319 OrthancPluginMemoryBuffer* target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5320 } _OrthancPluginWorklistQueryOperation;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5321
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5322 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5323 * @brief Test whether a worklist matches the query.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5324 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5325 * This function checks whether one worklist (encoded as a DICOM
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5326 * file) matches the C-Find SCP query against modality
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5327 * worklists. This function must be called before adding the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5328 * worklist as an answer through OrthancPluginWorklistAddAnswer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5329 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5330 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5331 * @param query The worklist query, as received by the callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5332 * @param dicom The worklist to answer, encoded as a DICOM file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5333 * @param size The size of the DICOM file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5334 * @return 1 if the worklist matches the query, 0 otherwise.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5335 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5336 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5337 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginWorklistIsMatch(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5338 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5339 const OrthancPluginWorklistQuery* query,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5340 const void* dicom,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5341 uint32_t size)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5342 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5343 int32_t isMatch = 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5344
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5345 _OrthancPluginWorklistQueryOperation params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5346 params.query = query;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5347 params.dicom = dicom;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5348 params.size = size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5349 params.isMatch = &isMatch;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5350 params.target = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5351
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5352 if (context->InvokeService(context, _OrthancPluginService_WorklistIsMatch, &params) == OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5353 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5354 return isMatch;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5355 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5356 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5357 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5358 /* Error: Assume non-match */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5359 return 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5360 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5361 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5362
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5363
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5364 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5365 * @brief Retrieve the worklist query as a DICOM file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5366 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5367 * This function retrieves the DICOM file that underlies a C-Find
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5368 * SCP query against modality worklists.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5369 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5370 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5371 * @param target Memory buffer where to store the DICOM file. It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5372 * @param query The worklist query, as received by the callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5373 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5374 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5375 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5376 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginWorklistGetDicomQuery(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5377 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5378 OrthancPluginMemoryBuffer* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5379 const OrthancPluginWorklistQuery* query)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5380 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5381 _OrthancPluginWorklistQueryOperation params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5382 params.query = query;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5383 params.dicom = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5384 params.size = 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5385 params.isMatch = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5386 params.target = target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5387
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5388 return context->InvokeService(context, _OrthancPluginService_WorklistGetDicomQuery, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5389 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5390
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5391
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5392 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5393 * @brief Get the origin of a DICOM file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5394 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5395 * This function returns the origin of a DICOM instance that has been received by Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5396 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5397 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5398 * @param instance The instance of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5399 * @return The origin of the instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5400 * @ingroup DicomInstance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5401 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5402 ORTHANC_PLUGIN_INLINE OrthancPluginInstanceOrigin OrthancPluginGetInstanceOrigin(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5403 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5404 const OrthancPluginDicomInstance* instance)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5405 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5406 OrthancPluginInstanceOrigin origin;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5407
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5408 _OrthancPluginAccessDicomInstance params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5409 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5410 params.resultOrigin = &origin;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5411 params.instance = instance;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5412
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5413 if (context->InvokeService(context, _OrthancPluginService_GetInstanceOrigin, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5414 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5415 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5416 return OrthancPluginInstanceOrigin_Unknown;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5417 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5418 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5419 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5420 return origin;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5421 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5422 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5423
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5424
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5425 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5426 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5427 OrthancPluginMemoryBuffer* target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5428 const char* json;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5429 const OrthancPluginImage* pixelData;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5430 OrthancPluginCreateDicomFlags flags;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5431 } _OrthancPluginCreateDicom;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5432
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5433 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5434 * @brief Create a DICOM instance from a JSON string and an image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5435 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5436 * This function takes as input a string containing a JSON file
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5437 * describing the content of a DICOM instance. As an output, it
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5438 * writes the corresponding DICOM instance to a newly allocated
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5439 * memory buffer. Additionally, an image to be encoded within the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5440 * DICOM instance can also be provided.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5441 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5442 * Private tags will be associated with the private creator whose
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5443 * value is specified in the "DefaultPrivateCreator" configuration
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5444 * option of Orthanc. The function OrthancPluginCreateDicom2() can
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5445 * be used if another private creator must be used to create this
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5446 * instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5447 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5448 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5449 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5450 * @param json The input JSON file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5451 * @param pixelData The image. Can be NULL, if the pixel data is encoded inside the JSON with the data URI scheme.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5452 * @param flags Flags governing the output.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5453 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5454 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5455 * @see OrthancPluginCreateDicom2()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5456 * @see OrthancPluginDicomBufferToJson()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5457 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5458 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCreateDicom(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5459 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5460 OrthancPluginMemoryBuffer* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5461 const char* json,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5462 const OrthancPluginImage* pixelData,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5463 OrthancPluginCreateDicomFlags flags)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5464 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5465 _OrthancPluginCreateDicom params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5466 params.target = target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5467 params.json = json;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5468 params.pixelData = pixelData;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5469 params.flags = flags;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5470
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5471 return context->InvokeService(context, _OrthancPluginService_CreateDicom, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5472 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5473
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5474
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5475 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5476 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5477 OrthancPluginDecodeImageCallback callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5478 } _OrthancPluginDecodeImageCallback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5479
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5480 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5481 * @brief Register a callback to handle the decoding of DICOM images.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5482 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5483 * This function registers a custom callback to decode DICOM images,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5484 * extending the built-in decoder of Orthanc that uses
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5485 * DCMTK. Starting with Orthanc 1.7.0, the exact behavior is
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5486 * affected by the configuration option
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5487 * "BuiltinDecoderTranscoderOrder" of Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5488 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5489 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5490 * @param callback The callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5491 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5492 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5493 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5494 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDecodeImageCallback(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5495 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5496 OrthancPluginDecodeImageCallback callback)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5497 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5498 _OrthancPluginDecodeImageCallback params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5499 params.callback = callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5500
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5501 return context->InvokeService(context, _OrthancPluginService_RegisterDecodeImageCallback, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5502 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5503
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5504
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5505
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5506 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5507 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5508 OrthancPluginImage** target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5509 OrthancPluginPixelFormat format;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5510 uint32_t width;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5511 uint32_t height;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5512 uint32_t pitch;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5513 void* buffer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5514 const void* constBuffer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5515 uint32_t bufferSize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5516 uint32_t frameIndex;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5517 } _OrthancPluginCreateImage;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5518
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5519
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5520 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5521 * @brief Create an image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5522 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5523 * This function creates an image of given size and format.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5524 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5525 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5526 * @param format The format of the pixels.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5527 * @param width The width of the image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5528 * @param height The height of the image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5529 * @return The newly allocated image. It must be freed with OrthancPluginFreeImage().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5530 * @ingroup Images
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5531 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5532 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginCreateImage(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5533 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5534 OrthancPluginPixelFormat format,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5535 uint32_t width,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5536 uint32_t height)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5537 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5538 OrthancPluginImage* target = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5539
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5540 _OrthancPluginCreateImage params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5541 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5542 params.target = &target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5543 params.format = format;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5544 params.width = width;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5545 params.height = height;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5546
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5547 if (context->InvokeService(context, _OrthancPluginService_CreateImage, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5548 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5549 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5550 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5551 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5552 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5553 return target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5554 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5555 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5556
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5557
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5558 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5559 * @brief Create an image pointing to a memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5560 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5561 * This function creates an image whose content points to a memory
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5562 * buffer managed by the plugin. Note that the buffer is directly
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5563 * accessed, no memory is allocated and no data is copied.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5564 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5565 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5566 * @param format The format of the pixels.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5567 * @param width The width of the image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5568 * @param height The height of the image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5569 * @param pitch The pitch of the image (i.e. the number of bytes
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5570 * between 2 successive lines of the image in the memory buffer).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5571 * @param buffer The memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5572 * @return The newly allocated image. It must be freed with OrthancPluginFreeImage().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5573 * @ingroup Images
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5574 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5575 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginCreateImageAccessor(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5576 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5577 OrthancPluginPixelFormat format,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5578 uint32_t width,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5579 uint32_t height,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5580 uint32_t pitch,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5581 void* buffer)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5582 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5583 OrthancPluginImage* target = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5584
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5585 _OrthancPluginCreateImage params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5586 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5587 params.target = &target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5588 params.format = format;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5589 params.width = width;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5590 params.height = height;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5591 params.pitch = pitch;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5592 params.buffer = buffer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5593
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5594 if (context->InvokeService(context, _OrthancPluginService_CreateImageAccessor, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5595 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5596 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5597 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5598 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5599 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5600 return target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5601 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5602 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5603
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5604
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5605
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5606 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5607 * @brief Decode one frame from a DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5608 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5609 * This function decodes one frame of a DICOM image that is stored
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5610 * in a memory buffer. This function will give the same result as
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5611 * OrthancPluginUncompressImage() for single-frame DICOM images.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5612 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5613 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5614 * @param buffer Pointer to a memory buffer containing the DICOM image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5615 * @param bufferSize Size of the memory buffer containing the DICOM image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5616 * @param frameIndex The index of the frame of interest in a multi-frame image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5617 * @return The uncompressed image. It must be freed with OrthancPluginFreeImage().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5618 * @ingroup Images
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5619 * @see OrthancPluginGetInstanceDecodedFrame()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5620 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5621 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginDecodeDicomImage(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5622 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5623 const void* buffer,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5624 uint32_t bufferSize,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5625 uint32_t frameIndex)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5626 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5627 OrthancPluginImage* target = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5628
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5629 _OrthancPluginCreateImage params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5630 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5631 params.target = &target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5632 params.constBuffer = buffer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5633 params.bufferSize = bufferSize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5634 params.frameIndex = frameIndex;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5635
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5636 if (context->InvokeService(context, _OrthancPluginService_DecodeDicomImage, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5637 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5638 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5639 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5640 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5641 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5642 return target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5643 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5644 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5645
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5646
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5647
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5648 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5649 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5650 char** result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5651 const void* buffer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5652 uint32_t size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5653 } _OrthancPluginComputeHash;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5654
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5655 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5656 * @brief Compute an MD5 hash.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5657 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5658 * This functions computes the MD5 cryptographic hash of the given memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5659 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5660 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5661 * @param buffer The source memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5662 * @param size The size in bytes of the source buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5663 * @return The NULL value in case of error, or a string containing the cryptographic hash.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5664 * This string must be freed by OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5665 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5666 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5667 ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeMd5(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5668 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5669 const void* buffer,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5670 uint32_t size)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5671 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5672 char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5673
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5674 _OrthancPluginComputeHash params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5675 params.result = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5676 params.buffer = buffer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5677 params.size = size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5678
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5679 if (context->InvokeService(context, _OrthancPluginService_ComputeMd5, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5680 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5681 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5682 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5683 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5684 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5685 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5686 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5687 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5688 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5689
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5690
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5691 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5692 * @brief Compute a SHA-1 hash.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5693 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5694 * This functions computes the SHA-1 cryptographic hash of the given memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5695 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5696 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5697 * @param buffer The source memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5698 * @param size The size in bytes of the source buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5699 * @return The NULL value in case of error, or a string containing the cryptographic hash.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5700 * This string must be freed by OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5701 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5702 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5703 ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeSha1(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5704 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5705 const void* buffer,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5706 uint32_t size)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5707 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5708 char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5709
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5710 _OrthancPluginComputeHash params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5711 params.result = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5712 params.buffer = buffer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5713 params.size = size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5714
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5715 if (context->InvokeService(context, _OrthancPluginService_ComputeSha1, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5716 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5717 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5718 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5719 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5720 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5721 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5722 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5723 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5724 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5725
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5726
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5727
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5728 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5729 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5730 OrthancPluginDictionaryEntry* target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5731 const char* name;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5732 } _OrthancPluginLookupDictionary;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5733
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5734 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5735 * @brief Get information about the given DICOM tag.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5736 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5737 * This functions makes a lookup in the dictionary of DICOM tags
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5738 * that are known to Orthanc, and returns information about this
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5739 * tag. The tag can be specified using its human-readable name
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5740 * (e.g. "PatientName") or a set of two hexadecimal numbers
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5741 * (e.g. "0010-0020").
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5742 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5743 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5744 * @param target Where to store the information about the tag.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5745 * @param name The name of the DICOM tag.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5746 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5747 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5748 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5749 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginLookupDictionary(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5750 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5751 OrthancPluginDictionaryEntry* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5752 const char* name)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5753 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5754 _OrthancPluginLookupDictionary params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5755 params.target = target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5756 params.name = name;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5757 return context->InvokeService(context, _OrthancPluginService_LookupDictionary, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5758 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5759
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5760
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5761
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5762 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5763 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5764 OrthancPluginRestOutput* output;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5765 const void* answer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5766 uint32_t answerSize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5767 uint32_t headersCount;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5768 const char* const* headersKeys;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5769 const char* const* headersValues;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5770 } _OrthancPluginSendMultipartItem2;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5771
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5772 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5773 * @brief Send an item as a part of some HTTP multipart answer, with custom headers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5774 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5775 * This function sends an item as a part of some HTTP multipart
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5776 * answer that was initiated by OrthancPluginStartMultipartAnswer(). In addition to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5777 * OrthancPluginSendMultipartItem(), this function will set HTTP header associated
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5778 * with the item.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5779 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5780 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5781 * @param output The HTTP connection to the client application.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5782 * @param answer Pointer to the memory buffer containing the item.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5783 * @param answerSize Number of bytes of the item.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5784 * @param headersCount The number of HTTP headers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5785 * @param headersKeys Array containing the keys of the HTTP headers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5786 * @param headersValues Array containing the values of the HTTP headers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5787 * @return 0 if success, or the error code if failure (this notably happens
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5788 * if the connection is closed by the client).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5789 * @see OrthancPluginSendMultipartItem()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5790 * @ingroup REST
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5791 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5792 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem2(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5793 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5794 OrthancPluginRestOutput* output,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5795 const void* answer,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5796 uint32_t answerSize,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5797 uint32_t headersCount,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5798 const char* const* headersKeys,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5799 const char* const* headersValues)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5800 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5801 _OrthancPluginSendMultipartItem2 params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5802 params.output = output;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5803 params.answer = answer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5804 params.answerSize = answerSize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5805 params.headersCount = headersCount;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5806 params.headersKeys = headersKeys;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5807 params.headersValues = headersValues;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5808
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5809 return context->InvokeService(context, _OrthancPluginService_SendMultipartItem2, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5810 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5811
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5812
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5813 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5814 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5815 OrthancPluginIncomingHttpRequestFilter callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5816 } _OrthancPluginIncomingHttpRequestFilter;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5817
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5818 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5819 * @brief Register a callback to filter incoming HTTP requests.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5820 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5821 * This function registers a custom callback to filter incoming HTTP/REST
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5822 * requests received by the HTTP server of Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5823 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5824 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5825 * @param callback The callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5826 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5827 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5828 * @deprecated Please instead use OrthancPluginRegisterIncomingHttpRequestFilter2()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5829 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5830 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5831 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5832 OrthancPluginIncomingHttpRequestFilter callback)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5833 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5834 _OrthancPluginIncomingHttpRequestFilter params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5835 params.callback = callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5836
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5837 return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5838 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5839
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5840
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5841
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5842 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5843 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5844 OrthancPluginMemoryBuffer* answerBody;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5845 OrthancPluginMemoryBuffer* answerHeaders;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5846 uint16_t* httpStatus;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5847 OrthancPluginHttpMethod method;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5848 const char* url;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5849 uint32_t headersCount;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5850 const char* const* headersKeys;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5851 const char* const* headersValues;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5852 const void* body;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5853 uint32_t bodySize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5854 const char* username;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5855 const char* password;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5856 uint32_t timeout;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5857 const char* certificateFile;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5858 const char* certificateKeyFile;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5859 const char* certificateKeyPassword;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5860 uint8_t pkcs11;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5861 } _OrthancPluginCallHttpClient2;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5862
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5863
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5864
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5865 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5866 * @brief Issue a HTTP call with full flexibility.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5867 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5868 * Make a HTTP call to the given URL. The result to the query is
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5869 * stored into a newly allocated memory buffer. The HTTP request
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5870 * will be done accordingly to the global configuration of Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5871 * (in particular, the options "HttpProxy", "HttpTimeout",
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5872 * "HttpsVerifyPeers", "HttpsCACertificates", and "Pkcs11" will be
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5873 * taken into account).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5874 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5875 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5876 * @param answerBody The target memory buffer (out argument).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5877 * It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5878 * The value of this argument is ignored if the HTTP method is DELETE.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5879 * @param answerHeaders The target memory buffer for the HTTP headers in the answers (out argument).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5880 * The answer headers are formatted as a JSON object (associative array).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5881 * The buffer must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5882 * This argument can be set to NULL if the plugin has no interest in the HTTP headers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5883 * @param httpStatus The HTTP status after the execution of the request (out argument).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5884 * @param method HTTP method to be used.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5885 * @param url The URL of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5886 * @param headersCount The number of HTTP headers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5887 * @param headersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5888 * @param headersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5889 * @param username The username (can be <tt>NULL</tt> if no password protection).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5890 * @param password The password (can be <tt>NULL</tt> if no password protection).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5891 * @param body The HTTP body for a POST or PUT request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5892 * @param bodySize The size of the body.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5893 * @param timeout Timeout in seconds (0 for default timeout).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5894 * @param certificateFile Path to the client certificate for HTTPS, in PEM format
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5895 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5896 * @param certificateKeyFile Path to the key of the client certificate for HTTPS, in PEM format
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5897 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5898 * @param certificateKeyPassword Password to unlock the key of the client certificate
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5899 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5900 * @param pkcs11 Enable PKCS#11 client authentication for hardware security modules and smart cards.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5901 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5902 * @see OrthancPluginCallPeerApi()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5903 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5904 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5905 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginHttpClient(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5906 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5907 OrthancPluginMemoryBuffer* answerBody,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5908 OrthancPluginMemoryBuffer* answerHeaders,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5909 uint16_t* httpStatus,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5910 OrthancPluginHttpMethod method,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5911 const char* url,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5912 uint32_t headersCount,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5913 const char* const* headersKeys,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5914 const char* const* headersValues,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5915 const void* body,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5916 uint32_t bodySize,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5917 const char* username,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5918 const char* password,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5919 uint32_t timeout,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5920 const char* certificateFile,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5921 const char* certificateKeyFile,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5922 const char* certificateKeyPassword,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5923 uint8_t pkcs11)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5924 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5925 _OrthancPluginCallHttpClient2 params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5926 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5927
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5928 params.answerBody = answerBody;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5929 params.answerHeaders = answerHeaders;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5930 params.httpStatus = httpStatus;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5931 params.method = method;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5932 params.url = url;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5933 params.headersCount = headersCount;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5934 params.headersKeys = headersKeys;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5935 params.headersValues = headersValues;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5936 params.body = body;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5937 params.bodySize = bodySize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5938 params.username = username;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5939 params.password = password;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5940 params.timeout = timeout;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5941 params.certificateFile = certificateFile;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5942 params.certificateKeyFile = certificateKeyFile;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5943 params.certificateKeyPassword = certificateKeyPassword;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5944 params.pkcs11 = pkcs11;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5945
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5946 return context->InvokeService(context, _OrthancPluginService_CallHttpClient2, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5947 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5948
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5949
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5950 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5951 * @brief Generate an UUID.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5952 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5953 * Generate a random GUID/UUID (globally unique identifier).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5954 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5955 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5956 * @return NULL in the case of an error, or a newly allocated string
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5957 * containing the UUID. This string must be freed by OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5958 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5959 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5960 ORTHANC_PLUGIN_INLINE char* OrthancPluginGenerateUuid(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5961 OrthancPluginContext* context)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5962 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5963 char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5964
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5965 _OrthancPluginRetrieveDynamicString params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5966 params.result = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5967 params.argument = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5968
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5969 if (context->InvokeService(context, _OrthancPluginService_GenerateUuid, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5970 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5971 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5972 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5973 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5974 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5975 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5976 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5977 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5978 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5979
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5980
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5981
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5982
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5983 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5984 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5985 OrthancPluginFindCallback callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5986 } _OrthancPluginFindCallback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5987
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5988 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5989 * @brief Register a callback to handle C-Find requests.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5990 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5991 * This function registers a callback to handle C-Find SCP requests
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5992 * that are not related to modality worklists.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5993 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5994 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5995 * @param callback The callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5996 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5997 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5998 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5999 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterFindCallback(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6000 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6001 OrthancPluginFindCallback callback)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6002 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6003 _OrthancPluginFindCallback params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6004 params.callback = callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6005
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6006 return context->InvokeService(context, _OrthancPluginService_RegisterFindCallback, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6007 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6008
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6009
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6010 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6011 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6012 OrthancPluginFindAnswers *answers;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6013 const OrthancPluginFindQuery *query;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6014 const void *dicom;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6015 uint32_t size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6016 uint32_t index;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6017 uint32_t *resultUint32;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6018 uint16_t *resultGroup;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6019 uint16_t *resultElement;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6020 char **resultString;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6021 } _OrthancPluginFindOperation;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6022
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6023 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6024 * @brief Add one answer to some C-Find request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6025 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6026 * This function adds one answer (encoded as a DICOM file) to the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6027 * set of answers corresponding to some C-Find SCP request that is
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6028 * not related to modality worklists.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6029 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6030 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6031 * @param answers The set of answers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6032 * @param dicom The answer to be added, encoded as a DICOM file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6033 * @param size The size of the DICOM file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6034 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6035 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6036 * @see OrthancPluginCreateDicom()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6037 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6038 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginFindAddAnswer(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6039 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6040 OrthancPluginFindAnswers* answers,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6041 const void* dicom,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6042 uint32_t size)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6043 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6044 _OrthancPluginFindOperation params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6045 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6046 params.answers = answers;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6047 params.dicom = dicom;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6048 params.size = size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6049
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6050 return context->InvokeService(context, _OrthancPluginService_FindAddAnswer, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6051 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6052
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6053
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6054 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6055 * @brief Mark the set of C-Find answers as incomplete.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6056 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6057 * This function marks as incomplete the set of answers
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6058 * corresponding to some C-Find SCP request that is not related to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6059 * modality worklists. This must be used if canceling the handling
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6060 * of a request when too many answers are to be returned.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6061 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6062 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6063 * @param answers The set of answers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6064 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6065 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6066 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6067 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginFindMarkIncomplete(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6068 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6069 OrthancPluginFindAnswers* answers)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6070 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6071 _OrthancPluginFindOperation params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6072 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6073 params.answers = answers;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6074
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6075 return context->InvokeService(context, _OrthancPluginService_FindMarkIncomplete, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6076 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6077
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6078
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6079
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6080 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6081 * @brief Get the number of tags in a C-Find query.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6082 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6083 * This function returns the number of tags that are contained in
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6084 * the given C-Find query.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6085 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6086 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6087 * @param query The C-Find query.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6088 * @return The number of tags.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6089 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6090 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6091 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFindQuerySize(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6092 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6093 const OrthancPluginFindQuery* query)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6094 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6095 uint32_t count = 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6096
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6097 _OrthancPluginFindOperation params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6098 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6099 params.query = query;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6100 params.resultUint32 = &count;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6101
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6102 if (context->InvokeService(context, _OrthancPluginService_GetFindQuerySize, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6103 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6104 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6105 return 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6106 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6107 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6108 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6109 return count;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6110 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6111 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6112
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6113
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6114 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6115 * @brief Get one tag in a C-Find query.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6116 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6117 * This function returns the group and the element of one DICOM tag
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6118 * in the given C-Find query.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6119 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6120 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6121 * @param group The group of the tag (output).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6122 * @param element The element of the tag (output).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6123 * @param query The C-Find query.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6124 * @param index The index of the tag of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6125 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6126 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6127 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6128 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetFindQueryTag(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6129 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6130 uint16_t* group,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6131 uint16_t* element,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6132 const OrthancPluginFindQuery* query,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6133 uint32_t index)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6134 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6135 _OrthancPluginFindOperation params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6136 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6137 params.query = query;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6138 params.index = index;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6139 params.resultGroup = group;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6140 params.resultElement = element;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6141
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6142 return context->InvokeService(context, _OrthancPluginService_GetFindQueryTag, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6143 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6144
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6145
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6146 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6147 * @brief Get the symbolic name of one tag in a C-Find query.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6148 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6149 * This function returns the symbolic name of one DICOM tag in the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6150 * given C-Find query.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6151 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6152 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6153 * @param query The C-Find query.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6154 * @param index The index of the tag of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6155 * @return The NULL value in case of error, or a string containing the name of the tag.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6156 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6157 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6158 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6159 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryTagName(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6160 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6161 const OrthancPluginFindQuery* query,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6162 uint32_t index)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6163 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6164 char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6165
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6166 _OrthancPluginFindOperation params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6167 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6168 params.query = query;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6169 params.index = index;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6170 params.resultString = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6171
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6172 if (context->InvokeService(context, _OrthancPluginService_GetFindQueryTagName, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6173 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6174 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6175 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6176 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6177 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6178 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6179 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6180 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6181 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6182
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6183
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6184 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6185 * @brief Get the value associated with one tag in a C-Find query.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6186 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6187 * This function returns the value associated with one tag in the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6188 * given C-Find query.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6189 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6190 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6191 * @param query The C-Find query.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6192 * @param index The index of the tag of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6193 * @return The NULL value in case of error, or a string containing the value of the tag.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6194 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6195 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6196 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6197 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetFindQueryValue(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6198 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6199 const OrthancPluginFindQuery* query,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6200 uint32_t index)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6201 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6202 char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6203
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6204 _OrthancPluginFindOperation params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6205 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6206 params.query = query;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6207 params.index = index;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6208 params.resultString = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6209
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6210 if (context->InvokeService(context, _OrthancPluginService_GetFindQueryValue, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6211 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6212 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6213 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6214 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6215 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6216 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6217 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6218 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6219 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6220
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6221
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6222
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6223
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6224 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6225 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6226 OrthancPluginMoveCallback callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6227 OrthancPluginGetMoveSize getMoveSize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6228 OrthancPluginApplyMove applyMove;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6229 OrthancPluginFreeMove freeMove;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6230 } _OrthancPluginMoveCallback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6231
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6232 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6233 * @brief Register a callback to handle C-Move requests.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6234 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6235 * This function registers a callback to handle C-Move SCP requests.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6236 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6237 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6238 * @param callback The main callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6239 * @param getMoveSize Callback to read the number of C-Move suboperations.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6240 * @param applyMove Callback to apply one C-Move suboperation.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6241 * @param freeMove Callback to free the C-Move driver.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6242 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6243 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6244 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6245 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterMoveCallback(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6246 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6247 OrthancPluginMoveCallback callback,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6248 OrthancPluginGetMoveSize getMoveSize,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6249 OrthancPluginApplyMove applyMove,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6250 OrthancPluginFreeMove freeMove)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6251 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6252 _OrthancPluginMoveCallback params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6253 params.callback = callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6254 params.getMoveSize = getMoveSize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6255 params.applyMove = applyMove;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6256 params.freeMove = freeMove;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6257
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6258 return context->InvokeService(context, _OrthancPluginService_RegisterMoveCallback, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6259 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6260
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6261
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6262
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6263 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6264 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6265 OrthancPluginFindMatcher** target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6266 const void* query;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6267 uint32_t size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6268 } _OrthancPluginCreateFindMatcher;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6269
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6270
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6271 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6272 * @brief Create a C-Find matcher.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6273 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6274 * This function creates a "matcher" object that can be used to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6275 * check whether a DICOM instance matches a C-Find query. The C-Find
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6276 * query must be expressed as a DICOM buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6277 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6278 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6279 * @param query The C-Find DICOM query.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6280 * @param size The size of the DICOM query.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6281 * @return The newly allocated matcher. It must be freed with OrthancPluginFreeFindMatcher().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6282 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6283 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6284 ORTHANC_PLUGIN_INLINE OrthancPluginFindMatcher* OrthancPluginCreateFindMatcher(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6285 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6286 const void* query,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6287 uint32_t size)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6288 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6289 OrthancPluginFindMatcher* target = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6290
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6291 _OrthancPluginCreateFindMatcher params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6292 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6293 params.target = &target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6294 params.query = query;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6295 params.size = size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6296
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6297 if (context->InvokeService(context, _OrthancPluginService_CreateFindMatcher, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6298 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6299 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6300 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6301 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6302 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6303 return target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6304 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6305 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6306
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6307
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6308 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6309 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6310 OrthancPluginFindMatcher* matcher;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6311 } _OrthancPluginFreeFindMatcher;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6312
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6313 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6314 * @brief Free a C-Find matcher.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6315 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6316 * This function frees a matcher that was created using OrthancPluginCreateFindMatcher().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6317 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6318 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6319 * @param matcher The matcher of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6320 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6321 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6322 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeFindMatcher(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6323 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6324 OrthancPluginFindMatcher* matcher)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6325 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6326 _OrthancPluginFreeFindMatcher params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6327 params.matcher = matcher;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6328
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6329 context->InvokeService(context, _OrthancPluginService_FreeFindMatcher, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6330 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6331
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6332
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6333 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6334 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6335 const OrthancPluginFindMatcher* matcher;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6336 const void* dicom;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6337 uint32_t size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6338 int32_t* isMatch;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6339 } _OrthancPluginFindMatcherIsMatch;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6340
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6341 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6342 * @brief Test whether a DICOM instance matches a C-Find query.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6343 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6344 * This function checks whether one DICOM instance matches C-Find
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6345 * matcher that was previously allocated using
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6346 * OrthancPluginCreateFindMatcher().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6347 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6348 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6349 * @param matcher The matcher of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6350 * @param dicom The DICOM instance to be matched.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6351 * @param size The size of the DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6352 * @return 1 if the DICOM instance matches the query, 0 otherwise.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6353 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6354 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6355 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginFindMatcherIsMatch(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6356 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6357 const OrthancPluginFindMatcher* matcher,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6358 const void* dicom,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6359 uint32_t size)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6360 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6361 int32_t isMatch = 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6362
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6363 _OrthancPluginFindMatcherIsMatch params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6364 params.matcher = matcher;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6365 params.dicom = dicom;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6366 params.size = size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6367 params.isMatch = &isMatch;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6368
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6369 if (context->InvokeService(context, _OrthancPluginService_FindMatcherIsMatch, &params) == OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6370 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6371 return isMatch;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6372 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6373 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6374 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6375 /* Error: Assume non-match */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6376 return 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6377 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6378 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6379
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6380
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6381 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6382 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6383 OrthancPluginIncomingHttpRequestFilter2 callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6384 } _OrthancPluginIncomingHttpRequestFilter2;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6385
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6386 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6387 * @brief Register a callback to filter incoming HTTP requests.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6388 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6389 * This function registers a custom callback to filter incoming HTTP/REST
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6390 * requests received by the HTTP server of Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6391 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6392 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6393 * @param callback The callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6394 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6395 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6396 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6397 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter2(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6398 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6399 OrthancPluginIncomingHttpRequestFilter2 callback)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6400 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6401 _OrthancPluginIncomingHttpRequestFilter2 params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6402 params.callback = callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6403
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6404 return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter2, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6405 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6406
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6407
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6408
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6409 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6410 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6411 OrthancPluginPeers** peers;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6412 } _OrthancPluginGetPeers;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6413
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6414 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6415 * @brief Return the list of available Orthanc peers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6416 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6417 * This function returns the parameters of the Orthanc peers that are known to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6418 * the Orthanc server hosting the plugin.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6419 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6420 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6421 * @return NULL if error, or a newly allocated opaque data structure containing the peers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6422 * This structure must be freed with OrthancPluginFreePeers().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6423 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6424 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6425 ORTHANC_PLUGIN_INLINE OrthancPluginPeers* OrthancPluginGetPeers(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6426 OrthancPluginContext* context)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6427 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6428 OrthancPluginPeers* peers = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6429
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6430 _OrthancPluginGetPeers params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6431 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6432 params.peers = &peers;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6433
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6434 if (context->InvokeService(context, _OrthancPluginService_GetPeers, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6435 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6436 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6437 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6438 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6439 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6440 return peers;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6441 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6442 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6443
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6444
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6445 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6446 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6447 OrthancPluginPeers* peers;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6448 } _OrthancPluginFreePeers;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6449
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6450 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6451 * @brief Free the list of available Orthanc peers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6452 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6453 * This function frees the data structure returned by OrthancPluginGetPeers().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6454 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6455 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6456 * @param peers The data structure describing the Orthanc peers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6457 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6458 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6459 ORTHANC_PLUGIN_INLINE void OrthancPluginFreePeers(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6460 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6461 OrthancPluginPeers* peers)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6462 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6463 _OrthancPluginFreePeers params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6464 params.peers = peers;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6465
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6466 context->InvokeService(context, _OrthancPluginService_FreePeers, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6467 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6468
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6469
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6470 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6471 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6472 uint32_t* target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6473 const OrthancPluginPeers* peers;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6474 } _OrthancPluginGetPeersCount;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6475
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6476 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6477 * @brief Get the number of Orthanc peers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6478 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6479 * This function returns the number of Orthanc peers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6480 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6481 * This function is thread-safe: Several threads sharing the same
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6482 * OrthancPluginPeers object can simultaneously call this function.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6483 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6484 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6485 * @param peers The data structure describing the Orthanc peers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6486 * @result The number of peers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6487 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6488 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6489 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetPeersCount(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6490 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6491 const OrthancPluginPeers* peers)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6492 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6493 uint32_t target = 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6494
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6495 _OrthancPluginGetPeersCount params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6496 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6497 params.target = &target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6498 params.peers = peers;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6499
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6500 if (context->InvokeService(context, _OrthancPluginService_GetPeersCount, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6501 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6502 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6503 return 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6504 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6505 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6506 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6507 return target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6508 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6509 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6510
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6511
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6512 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6513 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6514 const char** target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6515 const OrthancPluginPeers* peers;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6516 uint32_t peerIndex;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6517 const char* userProperty;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6518 } _OrthancPluginGetPeerProperty;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6519
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6520 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6521 * @brief Get the symbolic name of an Orthanc peer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6522 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6523 * This function returns the symbolic name of the Orthanc peer,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6524 * which corresponds to the key of the "OrthancPeers" configuration
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6525 * option of Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6526 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6527 * This function is thread-safe: Several threads sharing the same
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6528 * OrthancPluginPeers object can simultaneously call this function.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6529 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6530 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6531 * @param peers The data structure describing the Orthanc peers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6532 * @param peerIndex The index of the peer of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6533 * This value must be lower than OrthancPluginGetPeersCount().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6534 * @result The symbolic name, or NULL in the case of an error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6535 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6536 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6537 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerName(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6538 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6539 const OrthancPluginPeers* peers,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6540 uint32_t peerIndex)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6541 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6542 const char* target = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6543
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6544 _OrthancPluginGetPeerProperty params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6545 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6546 params.target = &target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6547 params.peers = peers;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6548 params.peerIndex = peerIndex;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6549 params.userProperty = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6550
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6551 if (context->InvokeService(context, _OrthancPluginService_GetPeerName, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6552 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6553 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6554 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6555 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6556 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6557 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6558 return target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6559 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6560 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6561
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6562
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6563 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6564 * @brief Get the base URL of an Orthanc peer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6565 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6566 * This function returns the base URL to the REST API of some Orthanc peer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6567 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6568 * This function is thread-safe: Several threads sharing the same
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6569 * OrthancPluginPeers object can simultaneously call this function.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6570 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6571 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6572 * @param peers The data structure describing the Orthanc peers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6573 * @param peerIndex The index of the peer of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6574 * This value must be lower than OrthancPluginGetPeersCount().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6575 * @result The URL, or NULL in the case of an error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6576 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6577 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6578 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerUrl(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6579 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6580 const OrthancPluginPeers* peers,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6581 uint32_t peerIndex)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6582 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6583 const char* target = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6584
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6585 _OrthancPluginGetPeerProperty params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6586 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6587 params.target = &target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6588 params.peers = peers;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6589 params.peerIndex = peerIndex;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6590 params.userProperty = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6591
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6592 if (context->InvokeService(context, _OrthancPluginService_GetPeerUrl, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6593 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6594 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6595 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6596 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6597 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6598 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6599 return target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6600 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6601 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6602
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6603
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6604
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6605 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6606 * @brief Get some user-defined property of an Orthanc peer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6607 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6608 * This function returns some user-defined property of some Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6609 * peer. An user-defined property is a property that is associated
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6610 * with the peer in the Orthanc configuration file, but that is not
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6611 * recognized by the Orthanc core.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6612 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6613 * This function is thread-safe: Several threads sharing the same
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6614 * OrthancPluginPeers object can simultaneously call this function.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6615 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6616 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6617 * @param peers The data structure describing the Orthanc peers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6618 * @param peerIndex The index of the peer of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6619 * This value must be lower than OrthancPluginGetPeersCount().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6620 * @param userProperty The user property of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6621 * @result The value of the user property, or NULL if it is not defined.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6622 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6623 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6624 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerUserProperty(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6625 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6626 const OrthancPluginPeers* peers,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6627 uint32_t peerIndex,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6628 const char* userProperty)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6629 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6630 const char* target = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6631
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6632 _OrthancPluginGetPeerProperty params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6633 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6634 params.target = &target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6635 params.peers = peers;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6636 params.peerIndex = peerIndex;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6637 params.userProperty = userProperty;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6638
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6639 if (context->InvokeService(context, _OrthancPluginService_GetPeerUserProperty, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6640 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6641 /* No such user property */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6642 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6643 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6644 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6645 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6646 return target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6647 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6648 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6649
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6650
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6651
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6652 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6653 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6654 OrthancPluginMemoryBuffer* answerBody;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6655 OrthancPluginMemoryBuffer* answerHeaders;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6656 uint16_t* httpStatus;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6657 const OrthancPluginPeers* peers;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6658 uint32_t peerIndex;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6659 OrthancPluginHttpMethod method;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6660 const char* uri;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6661 uint32_t additionalHeadersCount;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6662 const char* const* additionalHeadersKeys;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6663 const char* const* additionalHeadersValues;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6664 const void* body;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6665 uint32_t bodySize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6666 uint32_t timeout;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6667 } _OrthancPluginCallPeerApi;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6668
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6669 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6670 * @brief Call the REST API of an Orthanc peer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6671 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6672 * Make a REST call to the given URI in the REST API of a remote
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6673 * Orthanc peer. The result to the query is stored into a newly
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6674 * allocated memory buffer. The HTTP request will be done according
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6675 * to the "OrthancPeers" configuration option of Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6676 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6677 * This function is thread-safe: Several threads sharing the same
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6678 * OrthancPluginPeers object can simultaneously call this function.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6679 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6680 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6681 * @param answerBody The target memory buffer (out argument).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6682 * It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6683 * The value of this argument is ignored if the HTTP method is DELETE.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6684 * @param answerHeaders The target memory buffer for the HTTP headers in the answers (out argument).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6685 * The answer headers are formatted as a JSON object (associative array).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6686 * The buffer must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6687 * This argument can be set to NULL if the plugin has no interest in the HTTP headers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6688 * @param httpStatus The HTTP status after the execution of the request (out argument).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6689 * @param peers The data structure describing the Orthanc peers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6690 * @param peerIndex The index of the peer of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6691 * This value must be lower than OrthancPluginGetPeersCount().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6692 * @param method HTTP method to be used.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6693 * @param uri The URI of interest in the REST API.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6694 * @param additionalHeadersCount The number of HTTP headers to be added to the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6695 * HTTP headers provided in the global configuration of Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6696 * @param additionalHeadersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6697 * @param additionalHeadersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6698 * @param body The HTTP body for a POST or PUT request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6699 * @param bodySize The size of the body.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6700 * @param timeout Timeout in seconds (0 for default timeout).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6701 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6702 * @see OrthancPluginHttpClient()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6703 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6704 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6705 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCallPeerApi(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6706 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6707 OrthancPluginMemoryBuffer* answerBody,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6708 OrthancPluginMemoryBuffer* answerHeaders,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6709 uint16_t* httpStatus,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6710 const OrthancPluginPeers* peers,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6711 uint32_t peerIndex,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6712 OrthancPluginHttpMethod method,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6713 const char* uri,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6714 uint32_t additionalHeadersCount,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6715 const char* const* additionalHeadersKeys,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6716 const char* const* additionalHeadersValues,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6717 const void* body,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6718 uint32_t bodySize,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6719 uint32_t timeout)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6720 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6721 _OrthancPluginCallPeerApi params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6722 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6723
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6724 params.answerBody = answerBody;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6725 params.answerHeaders = answerHeaders;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6726 params.httpStatus = httpStatus;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6727 params.peers = peers;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6728 params.peerIndex = peerIndex;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6729 params.method = method;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6730 params.uri = uri;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6731 params.additionalHeadersCount = additionalHeadersCount;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6732 params.additionalHeadersKeys = additionalHeadersKeys;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6733 params.additionalHeadersValues = additionalHeadersValues;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6734 params.body = body;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6735 params.bodySize = bodySize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6736 params.timeout = timeout;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6737
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6738 return context->InvokeService(context, _OrthancPluginService_CallPeerApi, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6739 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6740
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6741
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6742
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6743
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6744
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6745 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6746 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6747 OrthancPluginJob** target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6748 void *job;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6749 OrthancPluginJobFinalize finalize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6750 const char *type;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6751 OrthancPluginJobGetProgress getProgress;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6752 OrthancPluginJobGetContent getContent;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6753 OrthancPluginJobGetSerialized getSerialized;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6754 OrthancPluginJobStep step;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6755 OrthancPluginJobStop stop;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6756 OrthancPluginJobReset reset;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6757 } _OrthancPluginCreateJob;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6758
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6759 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6760 * @brief Create a custom job.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6761 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6762 * This function creates a custom job to be run by the jobs engine
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6763 * of Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6764 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6765 * Orthanc starts one dedicated thread per custom job that is
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6766 * running. It is guaranteed that all the callbacks will only be
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6767 * called from this single dedicated thread, in mutual exclusion: As
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6768 * a consequence, it is *not* mandatory to protect the various
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6769 * callbacks by mutexes.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6770 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6771 * The custom job can nonetheless launch its own processing threads
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6772 * on the first call to the "step()" callback, and stop them once
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6773 * the "stop()" callback is called.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6774 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6775 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6776 * @param job The job to be executed.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6777 * @param finalize The finalization callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6778 * @param type The type of the job, provided to the job unserializer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6779 * See OrthancPluginRegisterJobsUnserializer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6780 * @param getProgress The progress callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6781 * @param getContent The content callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6782 * @param getSerialized The serialization callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6783 * @param step The callback to execute the individual steps of the job.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6784 * @param stop The callback that is invoked once the job leaves the "running" state.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6785 * @param reset The callback that is invoked if a stopped job is started again.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6786 * @return The newly allocated job. It must be freed with OrthancPluginFreeJob(),
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6787 * as long as it is not submitted with OrthancPluginSubmitJob().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6788 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6789 * @deprecated This signature should not be used anymore since Orthanc SDK 1.11.3.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6790 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6791 ORTHANC_PLUGIN_INLINE OrthancPluginJob *OrthancPluginCreateJob(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6792 OrthancPluginContext *context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6793 void *job,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6794 OrthancPluginJobFinalize finalize,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6795 const char *type,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6796 OrthancPluginJobGetProgress getProgress,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6797 OrthancPluginJobGetContent getContent,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6798 OrthancPluginJobGetSerialized getSerialized,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6799 OrthancPluginJobStep step,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6800 OrthancPluginJobStop stop,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6801 OrthancPluginJobReset reset)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6802 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6803 OrthancPluginJob* target = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6804
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6805 _OrthancPluginCreateJob params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6806 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6807
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6808 params.target = &target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6809 params.job = job;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6810 params.finalize = finalize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6811 params.type = type;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6812 params.getProgress = getProgress;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6813 params.getContent = getContent;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6814 params.getSerialized = getSerialized;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6815 params.step = step;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6816 params.stop = stop;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6817 params.reset = reset;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6818
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6819 if (context->InvokeService(context, _OrthancPluginService_CreateJob, &params) != OrthancPluginErrorCode_Success ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6820 target == NULL)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6821 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6822 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6823 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6824 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6825 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6826 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6827 return target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6828 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6829 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6830
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6831
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6832 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6833 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6834 OrthancPluginJob** target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6835 void *job;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6836 OrthancPluginJobFinalize finalize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6837 const char *type;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6838 OrthancPluginJobGetProgress getProgress;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6839 OrthancPluginJobGetContent2 getContent;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6840 OrthancPluginJobGetSerialized2 getSerialized;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6841 OrthancPluginJobStep step;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6842 OrthancPluginJobStop stop;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6843 OrthancPluginJobReset reset;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6844 } _OrthancPluginCreateJob2;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6845
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6846 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6847 * @brief Create a custom job.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6848 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6849 * This function creates a custom job to be run by the jobs engine
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6850 * of Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6851 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6852 * Orthanc starts one dedicated thread per custom job that is
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6853 * running. It is guaranteed that all the callbacks will only be
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6854 * called from this single dedicated thread, in mutual exclusion: As
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6855 * a consequence, it is *not* mandatory to protect the various
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6856 * callbacks by mutexes.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6857 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6858 * The custom job can nonetheless launch its own processing threads
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6859 * on the first call to the "step()" callback, and stop them once
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6860 * the "stop()" callback is called.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6861 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6862 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6863 * @param job The job to be executed.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6864 * @param finalize The finalization callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6865 * @param type The type of the job, provided to the job unserializer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6866 * See OrthancPluginRegisterJobsUnserializer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6867 * @param getProgress The progress callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6868 * @param getContent The content callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6869 * @param getSerialized The serialization callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6870 * @param step The callback to execute the individual steps of the job.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6871 * @param stop The callback that is invoked once the job leaves the "running" state.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6872 * @param reset The callback that is invoked if a stopped job is started again.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6873 * @return The newly allocated job. It must be freed with OrthancPluginFreeJob(),
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6874 * as long as it is not submitted with OrthancPluginSubmitJob().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6875 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6876 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6877 ORTHANC_PLUGIN_INLINE OrthancPluginJob *OrthancPluginCreateJob2(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6878 OrthancPluginContext *context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6879 void *job,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6880 OrthancPluginJobFinalize finalize,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6881 const char *type,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6882 OrthancPluginJobGetProgress getProgress,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6883 OrthancPluginJobGetContent2 getContent,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6884 OrthancPluginJobGetSerialized2 getSerialized,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6885 OrthancPluginJobStep step,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6886 OrthancPluginJobStop stop,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6887 OrthancPluginJobReset reset)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6888 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6889 OrthancPluginJob* target = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6890
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6891 _OrthancPluginCreateJob2 params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6892 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6893
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6894 params.target = &target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6895 params.job = job;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6896 params.finalize = finalize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6897 params.type = type;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6898 params.getProgress = getProgress;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6899 params.getContent = getContent;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6900 params.getSerialized = getSerialized;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6901 params.step = step;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6902 params.stop = stop;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6903 params.reset = reset;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6904
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6905 if (context->InvokeService(context, _OrthancPluginService_CreateJob2, &params) != OrthancPluginErrorCode_Success ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6906 target == NULL)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6907 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6908 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6909 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6910 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6911 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6912 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6913 return target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6914 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6915 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6916
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6917
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6918 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6919 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6920 OrthancPluginJob* job;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6921 } _OrthancPluginFreeJob;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6922
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6923 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6924 * @brief Free a custom job.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6925 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6926 * This function frees an image that was created with OrthancPluginCreateJob().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6927 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6928 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6929 * @param job The job.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6930 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6931 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6932 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeJob(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6933 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6934 OrthancPluginJob* job)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6935 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6936 _OrthancPluginFreeJob params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6937 params.job = job;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6938
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6939 context->InvokeService(context, _OrthancPluginService_FreeJob, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6940 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6941
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6942
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6943
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6944 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6945 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6946 char** resultId;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6947 OrthancPluginJob *job;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6948 int32_t priority;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6949 } _OrthancPluginSubmitJob;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6950
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6951 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6952 * @brief Submit a new job to the jobs engine of Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6953 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6954 * This function adds the given job to the pending jobs of
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6955 * Orthanc. Orthanc will take take of freeing it by invoking the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6956 * finalization callback provided to OrthancPluginCreateJob().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6957 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6958 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6959 * @param job The job, as received by OrthancPluginCreateJob().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6960 * @param priority The priority of the job.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6961 * @return ID of the newly-submitted job. This string must be freed by OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6962 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6963 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6964 ORTHANC_PLUGIN_INLINE char *OrthancPluginSubmitJob(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6965 OrthancPluginContext *context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6966 OrthancPluginJob *job,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6967 int32_t priority)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6968 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6969 char* resultId = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6970
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6971 _OrthancPluginSubmitJob params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6972 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6973
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6974 params.resultId = &resultId;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6975 params.job = job;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6976 params.priority = priority;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6977
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6978 if (context->InvokeService(context, _OrthancPluginService_SubmitJob, &params) != OrthancPluginErrorCode_Success ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6979 resultId == NULL)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6980 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6981 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6982 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6983 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6984 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6985 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6986 return resultId;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6987 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6988 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6989
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6990
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6991
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6992 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6993 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6994 OrthancPluginJobsUnserializer unserializer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6995 } _OrthancPluginJobsUnserializer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6996
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6997 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6998 * @brief Register an unserializer for custom jobs.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6999 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7000 * This function registers an unserializer that decodes custom jobs
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7001 * from a JSON string. This callback is invoked when the jobs engine
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7002 * of Orthanc is started (on Orthanc initialization), for each job
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7003 * that is stored in the Orthanc database.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7004 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7005 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7006 * @param unserializer The job unserializer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7007 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7008 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7009 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterJobsUnserializer(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7010 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7011 OrthancPluginJobsUnserializer unserializer)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7012 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7013 _OrthancPluginJobsUnserializer params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7014 params.unserializer = unserializer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7015
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7016 context->InvokeService(context, _OrthancPluginService_RegisterJobsUnserializer, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7017 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7018
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7019
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7020
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7021 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7022 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7023 OrthancPluginRestOutput* output;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7024 const char* details;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7025 uint8_t log;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7026 } _OrthancPluginSetHttpErrorDetails;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7027
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7028 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7029 * @brief Provide a detailed description for an HTTP error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7030 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7031 * This function sets the detailed description associated with an
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7032 * HTTP error. This description will be displayed in the "Details"
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7033 * field of the JSON body of the HTTP answer. It is only taken into
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7034 * consideration if the REST callback returns an error code that is
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7035 * different from "OrthancPluginErrorCode_Success", and if the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7036 * "HttpDescribeErrors" configuration option of Orthanc is set to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7037 * "true".
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7038 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7039 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7040 * @param output The HTTP connection to the client application.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7041 * @param details The details of the error message.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7042 * @param log Whether to also write the detailed error to the Orthanc logs.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7043 * @ingroup REST
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7044 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7045 ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpErrorDetails(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7046 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7047 OrthancPluginRestOutput* output,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7048 const char* details,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7049 uint8_t log)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7050 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7051 _OrthancPluginSetHttpErrorDetails params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7052 params.output = output;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7053 params.details = details;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7054 params.log = log;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7055 context->InvokeService(context, _OrthancPluginService_SetHttpErrorDetails, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7056 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7057
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7058
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7059
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7060 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7061 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7062 const char** result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7063 const char* argument;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7064 } _OrthancPluginRetrieveStaticString;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7065
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7066 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7067 * @brief Detect the MIME type of a file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7068 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7069 * This function returns the MIME type of a file by inspecting its extension.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7070 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7071 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7072 * @param path Path to the file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7073 * @return The MIME type. This is a statically-allocated
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7074 * string, do not free it.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7075 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7076 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7077 ORTHANC_PLUGIN_INLINE const char* OrthancPluginAutodetectMimeType(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7078 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7079 const char* path)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7080 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7081 const char* result = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7082
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7083 _OrthancPluginRetrieveStaticString params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7084 params.result = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7085 params.argument = path;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7086
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7087 if (context->InvokeService(context, _OrthancPluginService_AutodetectMimeType, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7088 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7089 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7090 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7091 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7092 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7093 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7094 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7095 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7096 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7097
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7098
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7099
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7100 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7101 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7102 const char* name;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7103 float value;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7104 OrthancPluginMetricsType type;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7105 } _OrthancPluginSetMetricsValue;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7106
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7107 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7108 * @brief Set the value of a floating-point metrics.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7109 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7110 * This function sets the value of a floating-point metrics to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7111 * monitor the behavior of the plugin through tools such as
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7112 * Prometheus. The values of all the metrics are stored within the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7113 * Orthanc context.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7114 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7115 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7116 * @param name The name of the metrics to be set.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7117 * @param value The value of the metrics.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7118 * @param type The type of the metrics. This parameter is only taken into consideration
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7119 * the first time this metrics is set.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7120 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7121 * @see OrthancPluginSetMetricsIntegerValue()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7122 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7123 ORTHANC_PLUGIN_INLINE void OrthancPluginSetMetricsValue(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7124 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7125 const char* name,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7126 float value,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7127 OrthancPluginMetricsType type)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7128 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7129 _OrthancPluginSetMetricsValue params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7130 params.name = name;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7131 params.value = value;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7132 params.type = type;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7133 context->InvokeService(context, _OrthancPluginService_SetMetricsValue, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7134 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7135
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7136
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7137
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7138 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7139 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7140 OrthancPluginRefreshMetricsCallback callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7141 } _OrthancPluginRegisterRefreshMetricsCallback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7142
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7143 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7144 * @brief Register a callback to refresh the metrics.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7145 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7146 * This function registers a callback to refresh the metrics. The
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7147 * callback must make calls to OrthancPluginSetMetricsValue() or
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7148 * OrthancPluginSetMetricsIntegerValue().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7149 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7150 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7151 * @param callback The callback function to handle the refresh.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7152 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7153 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7154 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRefreshMetricsCallback(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7155 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7156 OrthancPluginRefreshMetricsCallback callback)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7157 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7158 _OrthancPluginRegisterRefreshMetricsCallback params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7159 params.callback = callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7160 context->InvokeService(context, _OrthancPluginService_RegisterRefreshMetricsCallback, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7161 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7162
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7163
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7164
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7165
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7166 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7167 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7168 char** target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7169 const void* dicom;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7170 uint32_t dicomSize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7171 OrthancPluginDicomWebBinaryCallback callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7172 } _OrthancPluginEncodeDicomWeb;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7173
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7174 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7175 * @brief Convert a DICOM instance to DICOMweb JSON.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7176 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7177 * This function converts a memory buffer containing a DICOM instance,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7178 * into its DICOMweb JSON representation.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7179 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7180 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7181 * @param dicom Pointer to the DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7182 * @param dicomSize Size of the DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7183 * @param callback Callback to set the value of the binary tags.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7184 * @see OrthancPluginCreateDicom()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7185 * @return The NULL value in case of error, or the JSON document. This string must
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7186 * be freed by OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7187 * @deprecated OrthancPluginEncodeDicomWebJson2()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7188 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7189 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7190 ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebJson(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7191 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7192 const void* dicom,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7193 uint32_t dicomSize,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7194 OrthancPluginDicomWebBinaryCallback callback)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7195 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7196 char* target = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7197
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7198 _OrthancPluginEncodeDicomWeb params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7199 params.target = &target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7200 params.dicom = dicom;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7201 params.dicomSize = dicomSize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7202 params.callback = callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7203
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7204 if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebJson, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7205 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7206 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7207 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7208 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7209 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7210 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7211 return target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7212 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7213 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7214
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7215
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7216 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7217 * @brief Convert a DICOM instance to DICOMweb XML.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7218 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7219 * This function converts a memory buffer containing a DICOM instance,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7220 * into its DICOMweb XML representation.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7221 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7222 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7223 * @param dicom Pointer to the DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7224 * @param dicomSize Size of the DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7225 * @param callback Callback to set the value of the binary tags.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7226 * @return The NULL value in case of error, or the XML document. This string must
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7227 * be freed by OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7228 * @see OrthancPluginCreateDicom()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7229 * @deprecated OrthancPluginEncodeDicomWebXml2()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7230 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7231 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7232 ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebXml(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7233 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7234 const void* dicom,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7235 uint32_t dicomSize,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7236 OrthancPluginDicomWebBinaryCallback callback)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7237 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7238 char* target = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7239
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7240 _OrthancPluginEncodeDicomWeb params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7241 params.target = &target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7242 params.dicom = dicom;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7243 params.dicomSize = dicomSize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7244 params.callback = callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7245
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7246 if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebXml, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7247 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7248 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7249 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7250 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7251 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7252 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7253 return target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7254 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7255 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7256
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7257
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7258
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7259 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7260 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7261 char** target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7262 const void* dicom;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7263 uint32_t dicomSize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7264 OrthancPluginDicomWebBinaryCallback2 callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7265 void* payload;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7266 } _OrthancPluginEncodeDicomWeb2;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7267
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7268 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7269 * @brief Convert a DICOM instance to DICOMweb JSON.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7270 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7271 * This function converts a memory buffer containing a DICOM instance,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7272 * into its DICOMweb JSON representation.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7273 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7274 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7275 * @param dicom Pointer to the DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7276 * @param dicomSize Size of the DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7277 * @param callback Callback to set the value of the binary tags.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7278 * @param payload User payload.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7279 * @return The NULL value in case of error, or the JSON document. This string must
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7280 * be freed by OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7281 * @see OrthancPluginCreateDicom()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7282 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7283 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7284 ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebJson2(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7285 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7286 const void* dicom,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7287 uint32_t dicomSize,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7288 OrthancPluginDicomWebBinaryCallback2 callback,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7289 void* payload)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7290 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7291 char* target = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7292
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7293 _OrthancPluginEncodeDicomWeb2 params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7294 params.target = &target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7295 params.dicom = dicom;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7296 params.dicomSize = dicomSize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7297 params.callback = callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7298 params.payload = payload;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7299
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7300 if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebJson2, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7301 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7302 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7303 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7304 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7305 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7306 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7307 return target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7308 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7309 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7310
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7311
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7312 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7313 * @brief Convert a DICOM instance to DICOMweb XML.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7314 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7315 * This function converts a memory buffer containing a DICOM instance,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7316 * into its DICOMweb XML representation.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7317 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7318 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7319 * @param dicom Pointer to the DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7320 * @param dicomSize Size of the DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7321 * @param callback Callback to set the value of the binary tags.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7322 * @param payload User payload.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7323 * @return The NULL value in case of error, or the XML document. This string must
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7324 * be freed by OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7325 * @see OrthancPluginCreateDicom()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7326 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7327 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7328 ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebXml2(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7329 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7330 const void* dicom,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7331 uint32_t dicomSize,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7332 OrthancPluginDicomWebBinaryCallback2 callback,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7333 void* payload)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7334 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7335 char* target = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7336
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7337 _OrthancPluginEncodeDicomWeb2 params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7338 params.target = &target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7339 params.dicom = dicom;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7340 params.dicomSize = dicomSize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7341 params.callback = callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7342 params.payload = payload;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7343
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7344 if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebXml2, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7345 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7346 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7347 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7348 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7349 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7350 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7351 return target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7352 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7353 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7354
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7355
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7356
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7357 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7358 * @brief Callback executed when a HTTP header is received during a chunked transfer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7359 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7360 * Signature of a callback function that is called by Orthanc acting
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7361 * as a HTTP client during a chunked HTTP transfer, as soon as it
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7362 * receives one HTTP header from the answer of the remote HTTP
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7363 * server.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7364 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7365 * @see OrthancPluginChunkedHttpClient()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7366 * @param answer The user payload, as provided by the calling plugin.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7367 * @param key The key of the HTTP header.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7368 * @param value The value of the HTTP header.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7369 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7370 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7371 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7372 typedef OrthancPluginErrorCode (*OrthancPluginChunkedClientAnswerAddHeader) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7373 void* answer,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7374 const char* key,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7375 const char* value);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7376
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7377
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7378 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7379 * @brief Callback executed when an answer chunk is received during a chunked transfer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7380 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7381 * Signature of a callback function that is called by Orthanc acting
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7382 * as a HTTP client during a chunked HTTP transfer, as soon as it
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7383 * receives one data chunk from the answer of the remote HTTP
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7384 * server.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7385 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7386 * @see OrthancPluginChunkedHttpClient()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7387 * @param answer The user payload, as provided by the calling plugin.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7388 * @param data The content of the data chunk.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7389 * @param size The size of the data chunk.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7390 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7391 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7392 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7393 typedef OrthancPluginErrorCode (*OrthancPluginChunkedClientAnswerAddChunk) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7394 void* answer,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7395 const void* data,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7396 uint32_t size);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7397
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7398
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7399 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7400 * @brief Callback to know whether the request body is entirely read during a chunked transfer
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7401 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7402 * Signature of a callback function that is called by Orthanc acting
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7403 * as a HTTP client during a chunked HTTP transfer, while reading
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7404 * the body of a POST or PUT request. The plugin must answer "1" as
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7405 * soon as the body is entirely read: The "request" data structure
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7406 * must act as an iterator.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7407 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7408 * @see OrthancPluginChunkedHttpClient()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7409 * @param request The user payload, as provided by the calling plugin.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7410 * @return "1" if the body is over, or "0" if there is still data to be read.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7411 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7412 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7413 typedef uint8_t (*OrthancPluginChunkedClientRequestIsDone) (void* request);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7414
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7415
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7416 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7417 * @brief Callback to advance in the request body during a chunked transfer
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7418 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7419 * Signature of a callback function that is called by Orthanc acting
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7420 * as a HTTP client during a chunked HTTP transfer, while reading
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7421 * the body of a POST or PUT request. This function asks the plugin
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7422 * to advance to the next chunk of data of the request body: The
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7423 * "request" data structure must act as an iterator.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7424 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7425 * @see OrthancPluginChunkedHttpClient()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7426 * @param request The user payload, as provided by the calling plugin.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7427 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7428 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7429 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7430 typedef OrthancPluginErrorCode (*OrthancPluginChunkedClientRequestNext) (void* request);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7431
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7432
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7433 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7434 * @brief Callback to read the current chunk of the request body during a chunked transfer
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7435 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7436 * Signature of a callback function that is called by Orthanc acting
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7437 * as a HTTP client during a chunked HTTP transfer, while reading
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7438 * the body of a POST or PUT request. The plugin must provide the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7439 * content of the current chunk of data of the request body.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7440 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7441 * @see OrthancPluginChunkedHttpClient()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7442 * @param request The user payload, as provided by the calling plugin.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7443 * @return The content of the current request chunk.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7444 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7445 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7446 typedef const void* (*OrthancPluginChunkedClientRequestGetChunkData) (void* request);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7447
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7448
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7449 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7450 * @brief Callback to read the size of the current request chunk during a chunked transfer
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7451 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7452 * Signature of a callback function that is called by Orthanc acting
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7453 * as a HTTP client during a chunked HTTP transfer, while reading
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7454 * the body of a POST or PUT request. The plugin must provide the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7455 * size of the current chunk of data of the request body.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7456 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7457 * @see OrthancPluginChunkedHttpClient()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7458 * @param request The user payload, as provided by the calling plugin.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7459 * @return The size of the current request chunk.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7460 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7461 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7462 typedef uint32_t (*OrthancPluginChunkedClientRequestGetChunkSize) (void* request);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7463
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7464
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7465 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7466 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7467 void* answer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7468 OrthancPluginChunkedClientAnswerAddChunk answerAddChunk;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7469 OrthancPluginChunkedClientAnswerAddHeader answerAddHeader;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7470 uint16_t* httpStatus;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7471 OrthancPluginHttpMethod method;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7472 const char* url;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7473 uint32_t headersCount;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7474 const char* const* headersKeys;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7475 const char* const* headersValues;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7476 void* request;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7477 OrthancPluginChunkedClientRequestIsDone requestIsDone;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7478 OrthancPluginChunkedClientRequestGetChunkData requestChunkData;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7479 OrthancPluginChunkedClientRequestGetChunkSize requestChunkSize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7480 OrthancPluginChunkedClientRequestNext requestNext;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7481 const char* username;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7482 const char* password;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7483 uint32_t timeout;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7484 const char* certificateFile;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7485 const char* certificateKeyFile;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7486 const char* certificateKeyPassword;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7487 uint8_t pkcs11;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7488 } _OrthancPluginChunkedHttpClient;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7489
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7490
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7491 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7492 * @brief Issue a HTTP call, using chunked HTTP transfers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7493 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7494 * Make a HTTP call to the given URL using chunked HTTP
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7495 * transfers. The request body is provided as an iterator over data
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7496 * chunks. The answer is provided as a sequence of function calls
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7497 * with the individual HTTP headers and answer chunks.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7498 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7499 * Contrarily to OrthancPluginHttpClient() that entirely stores the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7500 * request body and the answer body in memory buffers, this function
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7501 * uses chunked HTTP transfers. This results in a lower memory
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7502 * consumption. Pay attention to the fact that Orthanc servers with
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7503 * version <= 1.5.6 do not support chunked transfers: You must use
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7504 * OrthancPluginHttpClient() if contacting such older servers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7505 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7506 * The HTTP request will be done accordingly to the global
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7507 * configuration of Orthanc (in particular, the options "HttpProxy",
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7508 * "HttpTimeout", "HttpsVerifyPeers", "HttpsCACertificates", and
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7509 * "Pkcs11" will be taken into account).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7510 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7511 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7512 * @param answer The user payload for the answer body. It will be provided to the callbacks for the answer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7513 * @param answerAddChunk Callback function to report a data chunk from the answer body.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7514 * @param answerAddHeader Callback function to report an HTTP header sent by the remote server.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7515 * @param httpStatus The HTTP status after the execution of the request (out argument).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7516 * @param method HTTP method to be used.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7517 * @param url The URL of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7518 * @param headersCount The number of HTTP headers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7519 * @param headersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7520 * @param headersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7521 * @param request The user payload containing the request body, and acting as an iterator.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7522 * It will be provided to the callbacks for the request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7523 * @param requestIsDone Callback function to tell whether the request body is entirely read.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7524 * @param requestChunkData Callback function to get the content of the current data chunk of the request body.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7525 * @param requestChunkSize Callback function to get the size of the current data chunk of the request body.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7526 * @param requestNext Callback function to advance to the next data chunk of the request body.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7527 * @param username The username (can be <tt>NULL</tt> if no password protection).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7528 * @param password The password (can be <tt>NULL</tt> if no password protection).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7529 * @param timeout Timeout in seconds (0 for default timeout).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7530 * @param certificateFile Path to the client certificate for HTTPS, in PEM format
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7531 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7532 * @param certificateKeyFile Path to the key of the client certificate for HTTPS, in PEM format
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7533 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7534 * @param certificateKeyPassword Password to unlock the key of the client certificate
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7535 * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7536 * @param pkcs11 Enable PKCS#11 client authentication for hardware security modules and smart cards.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7537 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7538 * @see OrthancPluginHttpClient()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7539 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7540 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7541 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginChunkedHttpClient(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7542 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7543 void* answer,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7544 OrthancPluginChunkedClientAnswerAddChunk answerAddChunk,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7545 OrthancPluginChunkedClientAnswerAddHeader answerAddHeader,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7546 uint16_t* httpStatus,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7547 OrthancPluginHttpMethod method,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7548 const char* url,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7549 uint32_t headersCount,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7550 const char* const* headersKeys,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7551 const char* const* headersValues,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7552 void* request,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7553 OrthancPluginChunkedClientRequestIsDone requestIsDone,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7554 OrthancPluginChunkedClientRequestGetChunkData requestChunkData,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7555 OrthancPluginChunkedClientRequestGetChunkSize requestChunkSize,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7556 OrthancPluginChunkedClientRequestNext requestNext,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7557 const char* username,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7558 const char* password,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7559 uint32_t timeout,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7560 const char* certificateFile,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7561 const char* certificateKeyFile,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7562 const char* certificateKeyPassword,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7563 uint8_t pkcs11)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7564 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7565 _OrthancPluginChunkedHttpClient params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7566 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7567
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7568 /* In common with OrthancPluginHttpClient() */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7569 params.httpStatus = httpStatus;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7570 params.method = method;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7571 params.url = url;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7572 params.headersCount = headersCount;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7573 params.headersKeys = headersKeys;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7574 params.headersValues = headersValues;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7575 params.username = username;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7576 params.password = password;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7577 params.timeout = timeout;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7578 params.certificateFile = certificateFile;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7579 params.certificateKeyFile = certificateKeyFile;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7580 params.certificateKeyPassword = certificateKeyPassword;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7581 params.pkcs11 = pkcs11;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7582
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7583 /* For chunked body/answer */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7584 params.answer = answer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7585 params.answerAddChunk = answerAddChunk;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7586 params.answerAddHeader = answerAddHeader;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7587 params.request = request;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7588 params.requestIsDone = requestIsDone;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7589 params.requestChunkData = requestChunkData;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7590 params.requestChunkSize = requestChunkSize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7591 params.requestNext = requestNext;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7592
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7593 return context->InvokeService(context, _OrthancPluginService_ChunkedHttpClient, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7594 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7595
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7596
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7597
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7598 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7599 * @brief Opaque structure that reads the content of a HTTP request body during a chunked HTTP transfer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7600 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7601 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7602 typedef struct _OrthancPluginServerChunkedRequestReader_t OrthancPluginServerChunkedRequestReader;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7603
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7604
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7605
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7606 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7607 * @brief Callback to create a reader to handle incoming chunked HTTP transfers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7608 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7609 * Signature of a callback function that is called by Orthanc acting
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7610 * as a HTTP server that supports chunked HTTP transfers. This
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7611 * callback is only invoked if the HTTP method is POST or PUT. The
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7612 * callback must create an user-specific "reader" object that will
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7613 * be fed with the body of the incoming body.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7614 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7615 * @see OrthancPluginRegisterChunkedRestCallback()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7616 * @param reader Memory location that must be filled with the newly-created reader.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7617 * @param url The URI that is accessed.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7618 * @param request The body of the HTTP request. Note that "body" and "bodySize" are not used.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7619 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7620 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7621 typedef OrthancPluginErrorCode (*OrthancPluginServerChunkedRequestReaderFactory) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7622 OrthancPluginServerChunkedRequestReader** reader,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7623 const char* url,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7624 const OrthancPluginHttpRequest* request);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7625
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7626
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7627 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7628 * @brief Callback invoked whenever a new data chunk is available during a chunked transfer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7629 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7630 * Signature of a callback function that is called by Orthanc acting
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7631 * as a HTTP server that supports chunked HTTP transfers. This callback
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7632 * is invoked as soon as a new data chunk is available for the request body.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7633 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7634 * @see OrthancPluginRegisterChunkedRestCallback()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7635 * @param reader The user payload, as created by the OrthancPluginServerChunkedRequestReaderFactory() callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7636 * @param data The content of the data chunk.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7637 * @param size The size of the data chunk.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7638 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7639 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7640 typedef OrthancPluginErrorCode (*OrthancPluginServerChunkedRequestReaderAddChunk) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7641 OrthancPluginServerChunkedRequestReader* reader,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7642 const void* data,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7643 uint32_t size);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7644
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7645
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7646 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7647 * @brief Callback invoked whenever the request body is entirely received.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7648 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7649 * Signature of a callback function that is called by Orthanc acting
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7650 * as a HTTP server that supports chunked HTTP transfers. This
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7651 * callback is invoked as soon as the full body of the HTTP request
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7652 * is available. The plugin can then send its answer thanks to the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7653 * provided "output" object.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7654 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7655 * @see OrthancPluginRegisterChunkedRestCallback()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7656 * @param reader The user payload, as created by the OrthancPluginServerChunkedRequestReaderFactory() callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7657 * @param output The HTTP connection to the client application.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7658 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7659 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7660 typedef OrthancPluginErrorCode (*OrthancPluginServerChunkedRequestReaderExecute) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7661 OrthancPluginServerChunkedRequestReader* reader,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7662 OrthancPluginRestOutput* output);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7663
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7664
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7665 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7666 * @brief Callback invoked to release the resources associated with an incoming HTTP chunked transfer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7667 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7668 * Signature of a callback function that is called by Orthanc acting
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7669 * as a HTTP server that supports chunked HTTP transfers. This
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7670 * callback is invoked to release all the resources allocated by the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7671 * given reader. Note that this function might be invoked even if
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7672 * the entire body was not read, to deal with client error or
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7673 * disconnection.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7674 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7675 * @see OrthancPluginRegisterChunkedRestCallback()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7676 * @param reader The user payload, as created by the OrthancPluginServerChunkedRequestReaderFactory() callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7677 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7678 typedef void (*OrthancPluginServerChunkedRequestReaderFinalize) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7679 OrthancPluginServerChunkedRequestReader* reader);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7680
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7681 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7682 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7683 const char* pathRegularExpression;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7684 OrthancPluginRestCallback getHandler;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7685 OrthancPluginServerChunkedRequestReaderFactory postHandler;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7686 OrthancPluginRestCallback deleteHandler;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7687 OrthancPluginServerChunkedRequestReaderFactory putHandler;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7688 OrthancPluginServerChunkedRequestReaderAddChunk addChunk;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7689 OrthancPluginServerChunkedRequestReaderExecute execute;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7690 OrthancPluginServerChunkedRequestReaderFinalize finalize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7691 } _OrthancPluginChunkedRestCallback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7692
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7693
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7694 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7695 * @brief Register a REST callback to handle chunked HTTP transfers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7696 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7697 * This function registers a REST callback against a regular
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7698 * expression for a URI. This function must be called during the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7699 * initialization of the plugin, i.e. inside the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7700 * OrthancPluginInitialize() public function.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7701 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7702 * Contrarily to OrthancPluginRegisterRestCallback(), the callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7703 * will NOT be invoked in mutual exclusion, so it is up to the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7704 * plugin to implement the required locking mechanisms.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7705 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7706 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7707 * @param pathRegularExpression Regular expression for the URI. May contain groups.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7708 * @param getHandler The callback function to handle REST calls using the GET HTTP method.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7709 * @param postHandler The callback function to handle REST calls using the POST HTTP method.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7710 * @param deleteHandler The callback function to handle REST calls using the DELETE HTTP method.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7711 * @param putHandler The callback function to handle REST calls using the PUT HTTP method.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7712 * @param addChunk The callback invoked when a new chunk is available for the request body of a POST or PUT call.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7713 * @param execute The callback invoked once the entire body of a POST or PUT call is read.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7714 * @param finalize The callback invoked to release the resources associated with a POST or PUT call.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7715 * @see OrthancPluginRegisterRestCallbackNoLock()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7716 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7717 * @note
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7718 * The regular expression is case sensitive and must follow the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7719 * [Perl syntax](https://www.boost.org/doc/libs/1_67_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7720 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7721 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7722 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7723 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterChunkedRestCallback(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7724 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7725 const char* pathRegularExpression,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7726 OrthancPluginRestCallback getHandler,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7727 OrthancPluginServerChunkedRequestReaderFactory postHandler,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7728 OrthancPluginRestCallback deleteHandler,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7729 OrthancPluginServerChunkedRequestReaderFactory putHandler,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7730 OrthancPluginServerChunkedRequestReaderAddChunk addChunk,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7731 OrthancPluginServerChunkedRequestReaderExecute execute,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7732 OrthancPluginServerChunkedRequestReaderFinalize finalize)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7733 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7734 _OrthancPluginChunkedRestCallback params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7735 params.pathRegularExpression = pathRegularExpression;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7736 params.getHandler = getHandler;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7737 params.postHandler = postHandler;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7738 params.deleteHandler = deleteHandler;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7739 params.putHandler = putHandler;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7740 params.addChunk = addChunk;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7741 params.execute = execute;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7742 params.finalize = finalize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7743
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7744 context->InvokeService(context, _OrthancPluginService_RegisterChunkedRestCallback, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7745 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7746
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7747
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7748
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7749
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7750
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7751 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7752 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7753 char** result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7754 uint16_t group;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7755 uint16_t element;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7756 const char* privateCreator;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7757 } _OrthancPluginGetTagName;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7758
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7759 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7760 * @brief Returns the symbolic name of a DICOM tag.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7761 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7762 * This function makes a lookup to the dictionary of DICOM tags that
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7763 * are known to Orthanc, and returns the symbolic name of a DICOM tag.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7764 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7765 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7766 * @param group The group of the tag.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7767 * @param element The element of the tag.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7768 * @param privateCreator For private tags, the name of the private creator (can be NULL).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7769 * @return NULL in the case of an error, or a newly allocated string
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7770 * containing the path. This string must be freed by
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7771 * OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7772 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7773 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7774 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetTagName(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7775 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7776 uint16_t group,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7777 uint16_t element,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7778 const char* privateCreator)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7779 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7780 char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7781
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7782 _OrthancPluginGetTagName params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7783 params.result = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7784 params.group = group;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7785 params.element = element;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7786 params.privateCreator = privateCreator;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7787
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7788 if (context->InvokeService(context, _OrthancPluginService_GetTagName, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7789 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7790 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7791 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7792 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7793 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7794 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7795 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7796 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7797 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7798
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7799
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7800
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7801 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7802 * @brief Callback executed by the storage commitment SCP.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7803 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7804 * Signature of a factory function that creates an object to handle
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7805 * one incoming storage commitment request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7806 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7807 * @remark The factory receives the list of the SOP class/instance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7808 * UIDs of interest to the remote storage commitment SCU. This gives
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7809 * the factory the possibility to start some prefetch process
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7810 * upfront in the background, before the handler object is actually
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7811 * queried about the status of these DICOM instances.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7812 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7813 * @param handler Output variable where the factory puts the handler object it created.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7814 * @param jobId ID of the Orthanc job that is responsible for handling
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7815 * the storage commitment request. This job will successively look for the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7816 * status of all the individual queried DICOM instances.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7817 * @param transactionUid UID of the storage commitment transaction
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7818 * provided by the storage commitment SCU. It contains the value of the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7819 * (0008,1195) DICOM tag.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7820 * @param sopClassUids Array of the SOP class UIDs (0008,0016) that are queried by the SCU.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7821 * @param sopInstanceUids Array of the SOP instance UIDs (0008,0018) that are queried by the SCU.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7822 * @param countInstances Number of DICOM instances that are queried. This is the size
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7823 * of the `sopClassUids` and `sopInstanceUids` arrays.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7824 * @param remoteAet The AET of the storage commitment SCU.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7825 * @param calledAet The AET used by the SCU to contact the storage commitment SCP (i.e. Orthanc).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7826 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7827 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7828 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7829 typedef OrthancPluginErrorCode (*OrthancPluginStorageCommitmentFactory) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7830 void** handler /* out */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7831 const char* jobId,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7832 const char* transactionUid,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7833 const char* const* sopClassUids,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7834 const char* const* sopInstanceUids,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7835 uint32_t countInstances,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7836 const char* remoteAet,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7837 const char* calledAet);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7838
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7839
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7840 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7841 * @brief Callback to free one storage commitment SCP handler.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7842 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7843 * Signature of a callback function that releases the resources
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7844 * allocated by the factory of the storage commitment SCP. The
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7845 * handler is the return value of a previous call to the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7846 * OrthancPluginStorageCommitmentFactory() callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7847 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7848 * @param handler The handler object to be destructed.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7849 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7850 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7851 typedef void (*OrthancPluginStorageCommitmentDestructor) (void* handler);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7852
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7853
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7854 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7855 * @brief Callback to get the status of one DICOM instance in the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7856 * storage commitment SCP.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7857 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7858 * Signature of a callback function that is successively invoked for
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7859 * each DICOM instance that is queried by the remote storage
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7860 * commitment SCU. The function must be tought of as a method of
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7861 * the handler object that was created by a previous call to the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7862 * OrthancPluginStorageCommitmentFactory() callback. After each call
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7863 * to this method, the progress of the associated Orthanc job is
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7864 * updated.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7865 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7866 * @param target Output variable where to put the status for the queried instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7867 * @param handler The handler object associated with this storage commitment request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7868 * @param sopClassUid The SOP class UID (0008,0016) of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7869 * @param sopInstanceUid The SOP instance UID (0008,0018) of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7870 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7871 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7872 typedef OrthancPluginErrorCode (*OrthancPluginStorageCommitmentLookup) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7873 OrthancPluginStorageCommitmentFailureReason* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7874 void* handler,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7875 const char* sopClassUid,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7876 const char* sopInstanceUid);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7877
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7878
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7879 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7880 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7881 OrthancPluginStorageCommitmentFactory factory;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7882 OrthancPluginStorageCommitmentDestructor destructor;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7883 OrthancPluginStorageCommitmentLookup lookup;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7884 } _OrthancPluginRegisterStorageCommitmentScpCallback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7885
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7886 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7887 * @brief Register a callback to handle incoming requests to the storage commitment SCP.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7888 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7889 * This function registers a callback to handle storage commitment SCP requests.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7890 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7891 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7892 * @param factory Factory function that creates the handler object
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7893 * for incoming storage commitment requests.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7894 * @param destructor Destructor function to destroy the handler object.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7895 * @param lookup Callback function to get the status of one DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7896 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7897 * @ingroup DicomCallbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7898 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7899 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterStorageCommitmentScpCallback(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7900 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7901 OrthancPluginStorageCommitmentFactory factory,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7902 OrthancPluginStorageCommitmentDestructor destructor,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7903 OrthancPluginStorageCommitmentLookup lookup)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7904 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7905 _OrthancPluginRegisterStorageCommitmentScpCallback params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7906 params.factory = factory;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7907 params.destructor = destructor;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7908 params.lookup = lookup;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7909 return context->InvokeService(context, _OrthancPluginService_RegisterStorageCommitmentScpCallback, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7910 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7911
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7912
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7913
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7914 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7915 * @brief Callback to filter incoming DICOM instances received by Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7916 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7917 * Signature of a callback function that is triggered whenever
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7918 * Orthanc receives a new DICOM instance (e.g. through REST API or
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7919 * DICOM protocol), and that answers whether this DICOM instance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7920 * should be accepted or discarded by Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7921 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7922 * Note that the metadata information is not available
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7923 * (i.e. GetInstanceMetadata() should not be used on "instance").
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7924 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7925 * @warning Your callback function will be called synchronously with
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7926 * the core of Orthanc. This implies that deadlocks might emerge if
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7927 * you call other core primitives of Orthanc in your callback (such
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7928 * deadlocks are particularly visible in the presence of other plugins
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7929 * or Lua scripts). It is thus strongly advised to avoid any call to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7930 * the REST API of Orthanc in the callback. If you have to call
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7931 * other primitives of Orthanc, you should make these calls in a
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7932 * separate thread, passing the pending events to be processed
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7933 * through a message queue.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7934 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7935 * @param instance The received DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7936 * @return 0 to discard the instance, 1 to store the instance, -1 if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7937 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7938 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7939 typedef int32_t (*OrthancPluginIncomingDicomInstanceFilter) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7940 const OrthancPluginDicomInstance* instance);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7941
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7942
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7943 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7944 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7945 OrthancPluginIncomingDicomInstanceFilter callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7946 } _OrthancPluginIncomingDicomInstanceFilter;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7947
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7948 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7949 * @brief Register a callback to filter incoming DICOM instances.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7950 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7951 * This function registers a custom callback to filter incoming
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7952 * DICOM instances received by Orthanc (either through the REST API
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7953 * or through the DICOM protocol).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7954 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7955 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7956 * @param callback The callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7957 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7958 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7959 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7960 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingDicomInstanceFilter(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7961 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7962 OrthancPluginIncomingDicomInstanceFilter callback)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7963 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7964 _OrthancPluginIncomingDicomInstanceFilter params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7965 params.callback = callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7966
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7967 return context->InvokeService(context, _OrthancPluginService_RegisterIncomingDicomInstanceFilter, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7968 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7969
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7970
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7971 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7972 * @brief Callback to filter incoming DICOM instances received by
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7973 * Orthanc through C-STORE.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7974 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7975 * Signature of a callback function that is triggered whenever
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7976 * Orthanc receives a new DICOM instance using DICOM C-STORE, and
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7977 * that answers whether this DICOM instance should be accepted or
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7978 * discarded by Orthanc. If the instance is discarded, the callback
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7979 * can specify the DIMSE error code answered by the Orthanc C-STORE
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7980 * SCP.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7981 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7982 * Note that the metadata information is not available
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7983 * (i.e. GetInstanceMetadata() should not be used on "instance").
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7984 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7985 * @warning Your callback function will be called synchronously with
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7986 * the core of Orthanc. This implies that deadlocks might emerge if
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7987 * you call other core primitives of Orthanc in your callback (such
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7988 * deadlocks are particularly visible in the presence of other plugins
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7989 * or Lua scripts). It is thus strongly advised to avoid any call to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7990 * the REST API of Orthanc in the callback. If you have to call
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7991 * other primitives of Orthanc, you should make these calls in a
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7992 * separate thread, passing the pending events to be processed
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7993 * through a message queue.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7994 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7995 * @param dimseStatus If the DICOM instance is discarded,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7996 * DIMSE status to be sent by the C-STORE SCP of Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7997 * @param instance The received DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7998 * @return 0 to discard the instance, 1 to store the instance, -1 if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7999 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8000 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8001 typedef int32_t (*OrthancPluginIncomingCStoreInstanceFilter) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8002 uint16_t* dimseStatus /* out */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8003 const OrthancPluginDicomInstance* instance);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8004
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8005
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8006 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8007 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8008 OrthancPluginIncomingCStoreInstanceFilter callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8009 } _OrthancPluginIncomingCStoreInstanceFilter;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8010
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8011 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8012 * @brief Register a callback to filter incoming DICOM instances
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8013 * received by Orthanc through C-STORE.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8014 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8015 * This function registers a custom callback to filter incoming
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8016 * DICOM instances received by Orthanc through the DICOM protocol.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8017 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8018 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8019 * @param callback The callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8020 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8021 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8022 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8023 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingCStoreInstanceFilter(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8024 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8025 OrthancPluginIncomingCStoreInstanceFilter callback)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8026 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8027 _OrthancPluginIncomingCStoreInstanceFilter params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8028 params.callback = callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8029
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8030 return context->InvokeService(context, _OrthancPluginService_RegisterIncomingCStoreInstanceFilter, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8031 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8032
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8033 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8034 * @brief Callback to keep/discard/modify a DICOM instance received
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8035 * by Orthanc from any source (C-STORE or REST API)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8036 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8037 * Signature of a callback function that is triggered whenever
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8038 * Orthanc receives a new DICOM instance (through DICOM protocol or
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8039 * REST API), and that specifies an action to be applied to this
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8040 * newly received instance. The instance can be kept as it is, can
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8041 * be modified by the plugin, or can be discarded.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8042 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8043 * This callback is invoked immediately after reception, i.e. before
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8044 * transcoding and before filtering
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8045 * (cf. OrthancPluginRegisterIncomingDicomInstanceFilter()).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8046 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8047 * @warning Your callback function will be called synchronously with
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8048 * the core of Orthanc. This implies that deadlocks might emerge if
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8049 * you call other core primitives of Orthanc in your callback (such
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8050 * deadlocks are particularly visible in the presence of other plugins
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8051 * or Lua scripts). It is thus strongly advised to avoid any call to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8052 * the REST API of Orthanc in the callback. If you have to call
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8053 * other primitives of Orthanc, you should make these calls in a
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8054 * separate thread, passing the pending events to be processed
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8055 * through a message queue.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8056 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8057 * @param modifiedDicomBuffer A buffer containing the modified DICOM (output).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8058 * This buffer must be allocated using OrthancPluginCreateMemoryBuffer64()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8059 * and will be freed by the Orthanc core.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8060 * @param receivedDicomBuffer A buffer containing the received DICOM (input).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8061 * @param receivedDicomBufferSize The size of the received DICOM (input).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8062 * @param origin The origin of the DICOM instance (input).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8063 * @return `OrthancPluginReceivedInstanceAction_KeepAsIs` to accept the instance as is,<br/>
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8064 * `OrthancPluginReceivedInstanceAction_Modify` to store the modified DICOM contained in `modifiedDicomBuffer`,<br/>
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8065 * `OrthancPluginReceivedInstanceAction_Discard` to tell Orthanc to discard the instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8066 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8067 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8068 typedef OrthancPluginReceivedInstanceAction (*OrthancPluginReceivedInstanceCallback) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8069 OrthancPluginMemoryBuffer64* modifiedDicomBuffer,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8070 const void* receivedDicomBuffer,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8071 uint64_t receivedDicomBufferSize,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8072 OrthancPluginInstanceOrigin origin);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8073
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8074
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8075 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8076 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8077 OrthancPluginReceivedInstanceCallback callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8078 } _OrthancPluginReceivedInstanceCallback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8079
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8080 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8081 * @brief Register a callback to keep/discard/modify a DICOM instance received
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8082 * by Orthanc from any source (C-STORE or REST API)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8083 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8084 * This function registers a custom callback to keep/discard/modify
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8085 * incoming DICOM instances received by Orthanc from any source
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8086 * (C-STORE or REST API).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8087 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8088 * @warning Contrarily to
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8089 * OrthancPluginRegisterIncomingCStoreInstanceFilter() and
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8090 * OrthancPluginRegisterIncomingDicomInstanceFilter() that can be
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8091 * called by multiple plugins,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8092 * OrthancPluginRegisterReceivedInstanceCallback() can only be used
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8093 * by one single plugin.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8094 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8095 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8096 * @param callback The callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8097 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8098 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8099 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8100 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterReceivedInstanceCallback(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8101 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8102 OrthancPluginReceivedInstanceCallback callback)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8103 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8104 _OrthancPluginReceivedInstanceCallback params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8105 params.callback = callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8106
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8107 return context->InvokeService(context, _OrthancPluginService_RegisterReceivedInstanceCallback, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8108 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8109
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8110 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8111 * @brief Get the transfer syntax of a DICOM file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8112 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8113 * This function returns a pointer to a newly created string that
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8114 * contains the transfer syntax UID of the DICOM instance. The empty
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8115 * string might be returned if this information is unknown.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8116 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8117 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8118 * @param instance The instance of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8119 * @return The NULL value in case of error, or a string containing the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8120 * transfer syntax UID. This string must be freed by OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8121 * @ingroup DicomInstance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8122 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8123 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceTransferSyntaxUid(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8124 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8125 const OrthancPluginDicomInstance* instance)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8126 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8127 char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8128
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8129 _OrthancPluginAccessDicomInstance params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8130 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8131 params.resultStringToFree = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8132 params.instance = instance;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8133
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8134 if (context->InvokeService(context, _OrthancPluginService_GetInstanceTransferSyntaxUid, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8135 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8136 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8137 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8138 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8139 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8140 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8141 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8142 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8143 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8144
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8145
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8146 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8147 * @brief Check whether the DICOM file has pixel data.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8148 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8149 * This function returns a Boolean value indicating whether the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8150 * DICOM instance contains the pixel data (7FE0,0010) tag.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8151 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8152 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8153 * @param instance The instance of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8154 * @return "1" if the DICOM instance contains pixel data, or "0" if
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8155 * the tag is missing, or "-1" in the case of an error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8156 * @ingroup DicomInstance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8157 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8158 ORTHANC_PLUGIN_INLINE int32_t OrthancPluginHasInstancePixelData(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8159 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8160 const OrthancPluginDicomInstance* instance)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8161 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8162 int64_t hasPixelData;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8163
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8164 _OrthancPluginAccessDicomInstance params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8165 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8166 params.resultInt64 = &hasPixelData;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8167 params.instance = instance;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8168
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8169 if (context->InvokeService(context, _OrthancPluginService_HasInstancePixelData, &params) != OrthancPluginErrorCode_Success ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8170 hasPixelData < 0 ||
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8171 hasPixelData > 1)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8172 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8173 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8174 return -1;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8175 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8176 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8177 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8178 return (hasPixelData != 0);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8179 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8180 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8181
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8182
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8183
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8184
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8185
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8186
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8187 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8188 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8189 OrthancPluginDicomInstance** target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8190 const void* buffer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8191 uint32_t size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8192 const char* transferSyntax;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8193 } _OrthancPluginCreateDicomInstance;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8194
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8195 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8196 * @brief Parse a DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8197 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8198 * This function parses a memory buffer that contains a DICOM
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8199 * file. The function returns a new pointer to a data structure that
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8200 * is managed by the Orthanc core.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8201 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8202 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8203 * @param buffer The memory buffer containing the DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8204 * @param size The size of the memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8205 * @return The newly allocated DICOM instance. It must be freed with OrthancPluginFreeDicomInstance().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8206 * @ingroup DicomInstance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8207 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8208 ORTHANC_PLUGIN_INLINE OrthancPluginDicomInstance* OrthancPluginCreateDicomInstance(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8209 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8210 const void* buffer,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8211 uint32_t size)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8212 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8213 OrthancPluginDicomInstance* target = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8214
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8215 _OrthancPluginCreateDicomInstance params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8216 params.target = &target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8217 params.buffer = buffer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8218 params.size = size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8219
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8220 if (context->InvokeService(context, _OrthancPluginService_CreateDicomInstance, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8221 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8222 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8223 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8224 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8225 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8226 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8227 return target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8228 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8229 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8230
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8231 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8232 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8233 OrthancPluginDicomInstance* dicom;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8234 } _OrthancPluginFreeDicomInstance;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8235
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8236 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8237 * @brief Free a DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8238 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8239 * This function frees a DICOM instance that was parsed using
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8240 * OrthancPluginCreateDicomInstance().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8241 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8242 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8243 * @param dicom The DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8244 * @ingroup DicomInstance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8245 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8246 ORTHANC_PLUGIN_INLINE void OrthancPluginFreeDicomInstance(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8247 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8248 OrthancPluginDicomInstance* dicom)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8249 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8250 _OrthancPluginFreeDicomInstance params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8251 params.dicom = dicom;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8252
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8253 context->InvokeService(context, _OrthancPluginService_FreeDicomInstance, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8254 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8255
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8256
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8257 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8258 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8259 uint32_t* targetUint32;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8260 OrthancPluginMemoryBuffer* targetBuffer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8261 OrthancPluginImage** targetImage;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8262 char** targetStringToFree;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8263 const OrthancPluginDicomInstance* instance;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8264 uint32_t frameIndex;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8265 OrthancPluginDicomToJsonFormat format;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8266 OrthancPluginDicomToJsonFlags flags;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8267 uint32_t maxStringLength;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8268 OrthancPluginDicomWebBinaryCallback2 dicomWebCallback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8269 void* dicomWebPayload;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8270 } _OrthancPluginAccessDicomInstance2;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8271
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8272 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8273 * @brief Get the number of frames in a DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8274 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8275 * This function returns the number of frames that are part of a
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8276 * DICOM image managed by the Orthanc core.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8277 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8278 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8279 * @param instance The instance of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8280 * @return The number of frames (will be zero in the case of an error).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8281 * @ingroup DicomInstance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8282 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8283 ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetInstanceFramesCount(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8284 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8285 const OrthancPluginDicomInstance* instance)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8286 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8287 uint32_t count;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8288
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8289 _OrthancPluginAccessDicomInstance2 params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8290 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8291 params.targetUint32 = &count;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8292 params.instance = instance;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8293
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8294 if (context->InvokeService(context, _OrthancPluginService_GetInstanceFramesCount, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8295 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8296 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8297 return 0;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8298 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8299 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8300 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8301 return count;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8302 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8303 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8304
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8305
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8306 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8307 * @brief Get the raw content of a frame in a DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8308 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8309 * This function returns a memory buffer containing the raw content
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8310 * of a frame in a DICOM instance that is managed by the Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8311 * core. This is notably useful for compressed transfer syntaxes, as
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8312 * it gives access to the embedded files (such as JPEG, JPEG-LS or
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8313 * JPEG2k). The Orthanc core transparently reassembles the fragments
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8314 * to extract the raw frame.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8315 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8316 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8317 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8318 * @param instance The instance of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8319 * @param frameIndex The index of the frame of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8320 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8321 * @ingroup DicomInstance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8322 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8323 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetInstanceRawFrame(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8324 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8325 OrthancPluginMemoryBuffer* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8326 const OrthancPluginDicomInstance* instance,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8327 uint32_t frameIndex)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8328 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8329 _OrthancPluginAccessDicomInstance2 params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8330 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8331 params.targetBuffer = target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8332 params.instance = instance;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8333 params.frameIndex = frameIndex;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8334
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8335 return context->InvokeService(context, _OrthancPluginService_GetInstanceRawFrame, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8336 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8337
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8338
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8339 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8340 * @brief Decode one frame from a DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8341 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8342 * This function decodes one frame of a DICOM image that is managed
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8343 * by the Orthanc core.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8344 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8345 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8346 * @param instance The instance of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8347 * @param frameIndex The index of the frame of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8348 * @return The uncompressed image. It must be freed with OrthancPluginFreeImage().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8349 * @ingroup DicomInstance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8350 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8351 ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginGetInstanceDecodedFrame(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8352 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8353 const OrthancPluginDicomInstance* instance,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8354 uint32_t frameIndex)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8355 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8356 OrthancPluginImage* target = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8357
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8358 _OrthancPluginAccessDicomInstance2 params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8359 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8360 params.targetImage = &target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8361 params.instance = instance;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8362 params.frameIndex = frameIndex;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8363
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8364 if (context->InvokeService(context, _OrthancPluginService_GetInstanceDecodedFrame, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8365 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8366 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8367 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8368 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8369 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8370 return target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8371 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8372 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8373
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8374
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8375 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8376 * @brief Parse and transcode a DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8377 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8378 * This function parses a memory buffer that contains a DICOM file,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8379 * then transcodes it to the given transfer syntax. The function
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8380 * returns a new pointer to a data structure that is managed by the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8381 * Orthanc core.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8382 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8383 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8384 * @param buffer The memory buffer containing the DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8385 * @param size The size of the memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8386 * @param transferSyntax The transfer syntax UID for the transcoding.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8387 * @return The newly allocated DICOM instance. It must be freed with OrthancPluginFreeDicomInstance().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8388 * @ingroup DicomInstance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8389 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8390 ORTHANC_PLUGIN_INLINE OrthancPluginDicomInstance* OrthancPluginTranscodeDicomInstance(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8391 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8392 const void* buffer,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8393 uint32_t size,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8394 const char* transferSyntax)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8395 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8396 OrthancPluginDicomInstance* target = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8397
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8398 _OrthancPluginCreateDicomInstance params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8399 params.target = &target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8400 params.buffer = buffer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8401 params.size = size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8402 params.transferSyntax = transferSyntax;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8403
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8404 if (context->InvokeService(context, _OrthancPluginService_TranscodeDicomInstance, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8405 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8406 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8407 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8408 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8409 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8410 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8411 return target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8412 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8413 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8414
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8415 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8416 * @brief Writes a DICOM instance to a memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8417 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8418 * This function returns a memory buffer containing the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8419 * serialization of a DICOM instance that is managed by the Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8420 * core.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8421 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8422 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8423 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8424 * @param instance The instance of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8425 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8426 * @ingroup DicomInstance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8427 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8428 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSerializeDicomInstance(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8429 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8430 OrthancPluginMemoryBuffer* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8431 const OrthancPluginDicomInstance* instance)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8432 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8433 _OrthancPluginAccessDicomInstance2 params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8434 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8435 params.targetBuffer = target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8436 params.instance = instance;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8437
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8438 return context->InvokeService(context, _OrthancPluginService_SerializeDicomInstance, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8439 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8440
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8441
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8442 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8443 * @brief Format a DICOM memory buffer as a JSON string.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8444 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8445 * This function takes as DICOM instance managed by the Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8446 * core, and outputs a JSON string representing the tags of this
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8447 * DICOM file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8448 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8449 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8450 * @param instance The DICOM instance of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8451 * @param format The output format.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8452 * @param flags Flags governing the output.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8453 * @param maxStringLength The maximum length of a field. Too long fields will
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8454 * be output as "null". The 0 value means no maximum length.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8455 * @return The NULL value if the case of an error, or the JSON
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8456 * string. This string must be freed by OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8457 * @ingroup DicomInstance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8458 * @see OrthancPluginDicomBufferToJson()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8459 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8460 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceAdvancedJson(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8461 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8462 const OrthancPluginDicomInstance* instance,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8463 OrthancPluginDicomToJsonFormat format,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8464 OrthancPluginDicomToJsonFlags flags,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8465 uint32_t maxStringLength)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8466 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8467 char* result = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8468
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8469 _OrthancPluginAccessDicomInstance2 params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8470 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8471 params.targetStringToFree = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8472 params.instance = instance;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8473 params.format = format;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8474 params.flags = flags;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8475 params.maxStringLength = maxStringLength;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8476
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8477 if (context->InvokeService(context, _OrthancPluginService_GetInstanceAdvancedJson, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8478 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8479 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8480 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8481 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8482 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8483 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8484 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8485 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8486 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8487
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8488
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8489 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8490 * @brief Convert a DICOM instance to DICOMweb JSON.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8491 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8492 * This function converts a DICOM instance that is managed by the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8493 * Orthanc core, into its DICOMweb JSON representation.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8494 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8495 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8496 * @param instance The DICOM instance of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8497 * @param callback Callback to set the value of the binary tags.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8498 * @param payload User payload.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8499 * @return The NULL value in case of error, or the JSON document. This string must
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8500 * be freed by OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8501 * @ingroup DicomInstance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8502 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8503 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceDicomWebJson(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8504 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8505 const OrthancPluginDicomInstance* instance,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8506 OrthancPluginDicomWebBinaryCallback2 callback,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8507 void* payload)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8508 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8509 char* target = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8510
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8511 _OrthancPluginAccessDicomInstance2 params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8512 params.targetStringToFree = &target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8513 params.instance = instance;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8514 params.dicomWebCallback = callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8515 params.dicomWebPayload = payload;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8516
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8517 if (context->InvokeService(context, _OrthancPluginService_GetInstanceDicomWebJson, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8518 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8519 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8520 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8521 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8522 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8523 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8524 return target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8525 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8526 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8527
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8528
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8529 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8530 * @brief Convert a DICOM instance to DICOMweb XML.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8531 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8532 * This function converts a DICOM instance that is managed by the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8533 * Orthanc core, into its DICOMweb XML representation.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8534 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8535 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8536 * @param instance The DICOM instance of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8537 * @param callback Callback to set the value of the binary tags.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8538 * @param payload User payload.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8539 * @return The NULL value in case of error, or the XML document. This string must
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8540 * be freed by OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8541 * @ingroup DicomInstance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8542 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8543 ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceDicomWebXml(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8544 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8545 const OrthancPluginDicomInstance* instance,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8546 OrthancPluginDicomWebBinaryCallback2 callback,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8547 void* payload)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8548 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8549 char* target = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8550
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8551 _OrthancPluginAccessDicomInstance2 params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8552 params.targetStringToFree = &target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8553 params.instance = instance;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8554 params.dicomWebCallback = callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8555 params.dicomWebPayload = payload;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8556
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8557 if (context->InvokeService(context, _OrthancPluginService_GetInstanceDicomWebXml, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8558 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8559 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8560 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8561 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8562 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8563 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8564 return target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8565 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8566 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8567
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8568
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8569
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8570 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8571 * @brief Signature of a callback function to transcode a DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8572 * @param transcoded Target memory buffer. It must be allocated by the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8573 * plugin using OrthancPluginCreateMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8574 * @param buffer Memory buffer containing the source DICOM instance.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8575 * @param size Size of the source memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8576 * @param allowedSyntaxes A C array of possible transfer syntaxes UIDs for the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8577 * result of the transcoding. The plugin must choose by itself the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8578 * transfer syntax that will be used for the resulting DICOM image.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8579 * @param countSyntaxes The number of transfer syntaxes that are contained
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8580 * in the "allowedSyntaxes" array.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8581 * @param allowNewSopInstanceUid Whether the transcoding plugin can select
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8582 * a transfer syntax that will change the SOP instance UID (or, in other
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8583 * terms, whether the plugin can transcode using lossy compression).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8584 * @return 0 if success (i.e. image successfully transcoded and stored into
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8585 * "transcoded"), or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8586 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8587 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8588 typedef OrthancPluginErrorCode (*OrthancPluginTranscoderCallback) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8589 OrthancPluginMemoryBuffer* transcoded /* out */,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8590 const void* buffer,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8591 uint64_t size,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8592 const char* const* allowedSyntaxes,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8593 uint32_t countSyntaxes,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8594 uint8_t allowNewSopInstanceUid);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8595
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8596
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8597 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8598 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8599 OrthancPluginTranscoderCallback callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8600 } _OrthancPluginTranscoderCallback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8601
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8602 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8603 * @brief Register a callback to handle the transcoding of DICOM images.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8604 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8605 * This function registers a custom callback to transcode DICOM
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8606 * images, extending the built-in transcoder of Orthanc that uses
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8607 * DCMTK. The exact behavior is affected by the configuration option
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8608 * "BuiltinDecoderTranscoderOrder" of Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8609 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8610 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8611 * @param callback The callback.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8612 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8613 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8614 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8615 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterTranscoderCallback(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8616 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8617 OrthancPluginTranscoderCallback callback)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8618 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8619 _OrthancPluginTranscoderCallback params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8620 params.callback = callback;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8621
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8622 return context->InvokeService(context, _OrthancPluginService_RegisterTranscoderCallback, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8623 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8624
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8625
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8626
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8627 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8628 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8629 OrthancPluginMemoryBuffer* target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8630 uint32_t size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8631 } _OrthancPluginCreateMemoryBuffer;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8632
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8633 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8634 * @brief Create a 32-bit memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8635 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8636 * This function creates a memory buffer that is managed by the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8637 * Orthanc core. The main use case of this function is for plugins
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8638 * that act as DICOM transcoders.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8639 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8640 * Your plugin should never call "free()" on the resulting memory
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8641 * buffer, as the C library that is used by the plugin is in general
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8642 * not the same as the one used by the Orthanc core.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8643 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8644 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8645 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8646 * @param size Size of the memory buffer to be created.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8647 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8648 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8649 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8650 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCreateMemoryBuffer(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8651 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8652 OrthancPluginMemoryBuffer* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8653 uint32_t size)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8654 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8655 _OrthancPluginCreateMemoryBuffer params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8656 params.target = target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8657 params.size = size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8658
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8659 return context->InvokeService(context, _OrthancPluginService_CreateMemoryBuffer, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8660 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8661
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8662
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8663 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8664 * @brief Generate a token to grant full access to the REST API of Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8665 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8666 * This function generates a token that can be set in the HTTP
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8667 * header "Authorization" so as to grant full access to the REST API
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8668 * of Orthanc using an external HTTP client. Using this function
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8669 * avoids the need of adding a separate user in the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8670 * "RegisteredUsers" configuration of Orthanc, which eases
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8671 * deployments.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8672 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8673 * This feature is notably useful in multiprocess scenarios, where a
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8674 * subprocess created by a plugin has no access to the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8675 * "OrthancPluginContext", and thus cannot call
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8676 * "OrthancPluginRestApi[Get|Post|Put|Delete]()".
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8677 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8678 * This situation is frequently encountered in Python plugins, where
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8679 * the "multiprocessing" package can be used to bypass the Global
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8680 * Interpreter Lock (GIL) and thus to improve performance and
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8681 * concurrency.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8682 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8683 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8684 * @return The authorization token, or NULL value in the case of an error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8685 * This string must be freed by OrthancPluginFreeString().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8686 * @ingroup Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8687 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8688 ORTHANC_PLUGIN_INLINE char* OrthancPluginGenerateRestApiAuthorizationToken(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8689 OrthancPluginContext* context)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8690 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8691 char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8692
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8693 _OrthancPluginRetrieveDynamicString params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8694 params.result = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8695 params.argument = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8696
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8697 if (context->InvokeService(context, _OrthancPluginService_GenerateRestApiAuthorizationToken,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8698 &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8699 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8700 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8701 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8702 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8703 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8704 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8705 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8706 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8707 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8708
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8709
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8710
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8711 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8712 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8713 OrthancPluginMemoryBuffer64* target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8714 uint64_t size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8715 } _OrthancPluginCreateMemoryBuffer64;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8716
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8717 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8718 * @brief Create a 64-bit memory buffer.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8719 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8720 * This function creates a 64-bit memory buffer that is managed by
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8721 * the Orthanc core. The main use case of this function is for
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8722 * plugins that read files from the storage area.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8723 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8724 * Your plugin should never call "free()" on the resulting memory
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8725 * buffer, as the C library that is used by the plugin is in general
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8726 * not the same as the one used by the Orthanc core.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8727 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8728 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8729 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8730 * @param size Size of the memory buffer to be created.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8731 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8732 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8733 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8734 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCreateMemoryBuffer64(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8735 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8736 OrthancPluginMemoryBuffer64* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8737 uint64_t size)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8738 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8739 _OrthancPluginCreateMemoryBuffer64 params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8740 params.target = target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8741 params.size = size;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8742
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8743 return context->InvokeService(context, _OrthancPluginService_CreateMemoryBuffer64, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8744 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8745
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8746
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8747 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8748 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8749 OrthancPluginStorageCreate create;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8750 OrthancPluginStorageReadWhole readWhole;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8751 OrthancPluginStorageReadRange readRange;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8752 OrthancPluginStorageRemove remove;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8753 } _OrthancPluginRegisterStorageArea2;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8754
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8755 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8756 * @brief Register a custom storage area, with support for range request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8757 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8758 * This function registers a custom storage area, to replace the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8759 * built-in way Orthanc stores its files on the filesystem. This
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8760 * function must be called during the initialization of the plugin,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8761 * i.e. inside the OrthancPluginInitialize() public function.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8762 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8763 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8764 * @param create The callback function to store a file on the custom storage area.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8765 * @param readWhole The callback function to read a whole file from the custom storage area.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8766 * @param readRange The callback function to read some range of a file from the custom storage area.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8767 * If this feature is not supported by the plugin, this value can be set to NULL.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8768 * @param remove The callback function to remove a file from the custom storage area.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8769 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8770 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8771 ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterStorageArea2(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8772 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8773 OrthancPluginStorageCreate create,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8774 OrthancPluginStorageReadWhole readWhole,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8775 OrthancPluginStorageReadRange readRange,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8776 OrthancPluginStorageRemove remove)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8777 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8778 _OrthancPluginRegisterStorageArea2 params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8779 params.create = create;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8780 params.readWhole = readWhole;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8781 params.readRange = readRange;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8782 params.remove = remove;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8783 context->InvokeService(context, _OrthancPluginService_RegisterStorageArea2, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8784 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8785
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8786
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8787
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8788 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8789 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8790 _OrthancPluginCreateDicom createDicom;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8791 const char* privateCreator;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8792 } _OrthancPluginCreateDicom2;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8793
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8794 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8795 * @brief Create a DICOM instance from a JSON string and an image, with a private creator.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8796 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8797 * This function takes as input a string containing a JSON file
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8798 * describing the content of a DICOM instance. As an output, it
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8799 * writes the corresponding DICOM instance to a newly allocated
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8800 * memory buffer. Additionally, an image to be encoded within the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8801 * DICOM instance can also be provided.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8802 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8803 * Contrarily to the function OrthancPluginCreateDicom(), this
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8804 * function can be explicitly provided with a private creator.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8805 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8806 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8807 * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8808 * @param json The input JSON file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8809 * @param pixelData The image. Can be NULL, if the pixel data is encoded inside the JSON with the data URI scheme.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8810 * @param flags Flags governing the output.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8811 * @param privateCreator The private creator to be used for the private DICOM tags.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8812 * Check out the global configuration option "Dictionary" of Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8813 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8814 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8815 * @see OrthancPluginCreateDicom()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8816 * @see OrthancPluginDicomBufferToJson()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8817 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8818 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCreateDicom2(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8819 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8820 OrthancPluginMemoryBuffer* target,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8821 const char* json,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8822 const OrthancPluginImage* pixelData,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8823 OrthancPluginCreateDicomFlags flags,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8824 const char* privateCreator)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8825 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8826 _OrthancPluginCreateDicom2 params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8827 params.createDicom.target = target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8828 params.createDicom.json = json;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8829 params.createDicom.pixelData = pixelData;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8830 params.createDicom.flags = flags;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8831 params.privateCreator = privateCreator;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8832
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8833 return context->InvokeService(context, _OrthancPluginService_CreateDicom2, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8834 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8835
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8836
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8837
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8838
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8839
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8840
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8841 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8842 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8843 OrthancPluginMemoryBuffer* answerBody;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8844 OrthancPluginMemoryBuffer* answerHeaders;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8845 uint16_t* httpStatus;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8846 OrthancPluginHttpMethod method;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8847 const char* uri;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8848 uint32_t headersCount;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8849 const char* const* headersKeys;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8850 const char* const* headersValues;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8851 const void* body;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8852 uint32_t bodySize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8853 uint8_t afterPlugins;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8854 } _OrthancPluginCallRestApi;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8855
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8856 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8857 * @brief Call the REST API of Orthanc with full flexibility.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8858 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8859 * Make a call to the given URI in the REST API of Orthanc. The
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8860 * result to the query is stored into a newly allocated memory
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8861 * buffer. This function is always granted full access to the REST
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8862 * API (no credentials, nor security token is needed).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8863 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8864 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8865 * @param answerBody The target memory buffer (out argument).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8866 * It must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8867 * The value of this argument is ignored if the HTTP method is DELETE.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8868 * @param answerHeaders The target memory buffer for the HTTP headers in the answer (out argument).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8869 * The answer headers are formatted as a JSON object (associative array).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8870 * The buffer must be freed with OrthancPluginFreeMemoryBuffer().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8871 * This argument can be set to NULL if the plugin has no interest in the answer HTTP headers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8872 * @param httpStatus The HTTP status after the execution of the request (out argument).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8873 * @param method HTTP method to be used.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8874 * @param uri The URI of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8875 * @param headersCount The number of HTTP headers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8876 * @param headersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8877 * @param headersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8878 * @param body The HTTP body for a POST or PUT request.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8879 * @param bodySize The size of the body.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8880 * @param afterPlugins If 0, the built-in API of Orthanc is used.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8881 * If 1, the API is tainted by the plugins.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8882 * @return 0 if success, or the error code if failure.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8883 * @see OrthancPluginRestApiGet2(), OrthancPluginRestApiPost(), OrthancPluginRestApiPut(), OrthancPluginRestApiDelete()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8884 * @ingroup Orthanc
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8885 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8886 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCallRestApi(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8887 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8888 OrthancPluginMemoryBuffer* answerBody,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8889 OrthancPluginMemoryBuffer* answerHeaders,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8890 uint16_t* httpStatus,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8891 OrthancPluginHttpMethod method,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8892 const char* uri,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8893 uint32_t headersCount,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8894 const char* const* headersKeys,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8895 const char* const* headersValues,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8896 const void* body,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8897 uint32_t bodySize,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8898 uint8_t afterPlugins)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8899 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8900 _OrthancPluginCallRestApi params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8901 memset(&params, 0, sizeof(params));
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8902
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8903 params.answerBody = answerBody;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8904 params.answerHeaders = answerHeaders;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8905 params.httpStatus = httpStatus;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8906 params.method = method;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8907 params.uri = uri;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8908 params.headersCount = headersCount;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8909 params.headersKeys = headersKeys;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8910 params.headersValues = headersValues;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8911 params.body = body;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8912 params.bodySize = bodySize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8913 params.afterPlugins = afterPlugins;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8914
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8915 return context->InvokeService(context, _OrthancPluginService_CallRestApi, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8916 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8917
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8918
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8919
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8920 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8921 * @brief Opaque structure that represents a WebDAV collection.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8922 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8923 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8924 typedef struct _OrthancPluginWebDavCollection_t OrthancPluginWebDavCollection;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8925
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8926
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8927 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8928 * @brief Declare a file while returning the content of a folder.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8929 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8930 * This function declares a file while returning the content of a
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8931 * WebDAV folder.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8932 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8933 * @param collection Context of the collection.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8934 * @param name Base name of the file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8935 * @param dateTime The date and time of creation of the file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8936 * Check out the documentation of OrthancPluginWebDavRetrieveFile() for more information.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8937 * @param size Size of the file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8938 * @param mimeType The MIME type of the file. If empty or set to `NULL`,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8939 * Orthanc will do a best guess depending on the file extension.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8940 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8941 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8942 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8943 typedef OrthancPluginErrorCode (*OrthancPluginWebDavAddFile) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8944 OrthancPluginWebDavCollection* collection,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8945 const char* name,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8946 uint64_t size,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8947 const char* mimeType,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8948 const char* dateTime);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8949
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8950
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8951 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8952 * @brief Declare a subfolder while returning the content of a folder.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8953 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8954 * This function declares a subfolder while returning the content of a
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8955 * WebDAV folder.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8956 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8957 * @param collection Context of the collection.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8958 * @param name Base name of the subfolder.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8959 * @param dateTime The date and time of creation of the subfolder.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8960 * Check out the documentation of OrthancPluginWebDavRetrieveFile() for more information.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8961 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8962 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8963 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8964 typedef OrthancPluginErrorCode (*OrthancPluginWebDavAddFolder) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8965 OrthancPluginWebDavCollection* collection,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8966 const char* name,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8967 const char* dateTime);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8968
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8969
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8970 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8971 * @brief Retrieve the content of a file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8972 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8973 * This function is used to forward the content of a file from a
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8974 * WebDAV collection, to the core of Orthanc.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8975 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8976 * @param collection Context of the collection.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8977 * @param data Content of the file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8978 * @param size Size of the file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8979 * @param mimeType The MIME type of the file. If empty or set to `NULL`,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8980 * Orthanc will do a best guess depending on the file extension.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8981 * @param dateTime The date and time of creation of the file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8982 * It must be formatted as an ISO string of form
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8983 * `YYYYMMDDTHHMMSS,fffffffff` where T is the date-time
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8984 * separator. It must be expressed in UTC (it is the responsibility
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8985 * of the plugin to do the possible timezone
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8986 * conversions). Internally, this string will be parsed using
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8987 * `boost::posix_time::from_iso_string()`.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8988 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8989 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8990 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8991 typedef OrthancPluginErrorCode (*OrthancPluginWebDavRetrieveFile) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8992 OrthancPluginWebDavCollection* collection,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8993 const void* data,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8994 uint64_t size,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8995 const char* mimeType,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8996 const char* dateTime);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8997
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8998
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8999 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9000 * @brief Callback for testing the existence of a folder.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9001 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9002 * Signature of a callback function that tests whether the given
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9003 * path in the WebDAV collection exists and corresponds to a folder.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9004 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9005 * @param isExisting Pointer to a Boolean that must be set to `1` if the folder exists, or `0` otherwise.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9006 * @param pathSize Number of levels in the path.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9007 * @param pathItems Items making the path.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9008 * @param payload The user payload.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9009 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9010 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9011 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9012 typedef OrthancPluginErrorCode (*OrthancPluginWebDavIsExistingFolderCallback) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9013 uint8_t* isExisting, /* out */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9014 uint32_t pathSize,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9015 const char* const* pathItems,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9016 void* payload);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9017
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9018
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9019 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9020 * @brief Callback for listing the content of a folder.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9021 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9022 * Signature of a callback function that lists the content of a
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9023 * folder in the WebDAV collection. The callback must call the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9024 * provided `addFile()` and `addFolder()` functions to emit the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9025 * content of the folder.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9026 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9027 * @param isExisting Pointer to a Boolean that must be set to `1` if the folder exists, or `0` otherwise.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9028 * @param collection Context to be provided to `addFile()` and `addFolder()` functions.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9029 * @param addFile Function to add a file to the list.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9030 * @param addFolder Function to add a folder to the list.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9031 * @param pathSize Number of levels in the path.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9032 * @param pathItems Items making the path.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9033 * @param payload The user payload.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9034 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9035 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9036 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9037 typedef OrthancPluginErrorCode (*OrthancPluginWebDavListFolderCallback) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9038 uint8_t* isExisting, /* out */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9039 OrthancPluginWebDavCollection* collection,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9040 OrthancPluginWebDavAddFile addFile,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9041 OrthancPluginWebDavAddFolder addFolder,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9042 uint32_t pathSize,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9043 const char* const* pathItems,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9044 void* payload);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9045
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9046
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9047 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9048 * @brief Callback for retrieving the content of a file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9049 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9050 * Signature of a callback function that retrieves the content of a
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9051 * file in the WebDAV collection. The callback must call the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9052 * provided `retrieveFile()` function to emit the actual content of
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9053 * the file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9054 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9055 * @param collection Context to be provided to `retrieveFile()` function.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9056 * @param retrieveFile Function to return the content of the file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9057 * @param pathSize Number of levels in the path.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9058 * @param pathItems Items making the path.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9059 * @param payload The user payload.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9060 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9061 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9062 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9063 typedef OrthancPluginErrorCode (*OrthancPluginWebDavRetrieveFileCallback) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9064 OrthancPluginWebDavCollection* collection,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9065 OrthancPluginWebDavRetrieveFile retrieveFile,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9066 uint32_t pathSize,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9067 const char* const* pathItems,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9068 void* payload);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9069
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9070
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9071 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9072 * @brief Callback to store a file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9073 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9074 * Signature of a callback function that stores a file into the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9075 * WebDAV collection.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9076 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9077 * @param isReadOnly Pointer to a Boolean that must be set to `1` if the collection is read-only, or `0` otherwise.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9078 * @param pathSize Number of levels in the path.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9079 * @param pathItems Items making the path.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9080 * @param data Content of the file to be stored.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9081 * @param size Size of the file to be stored.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9082 * @param payload The user payload.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9083 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9084 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9085 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9086 typedef OrthancPluginErrorCode (*OrthancPluginWebDavStoreFileCallback) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9087 uint8_t* isReadOnly, /* out */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9088 uint32_t pathSize,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9089 const char* const* pathItems,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9090 const void* data,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9091 uint64_t size,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9092 void* payload);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9093
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9094
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9095 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9096 * @brief Callback to create a folder.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9097 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9098 * Signature of a callback function that creates a folder in the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9099 * WebDAV collection.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9100 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9101 * @param isReadOnly Pointer to a Boolean that must be set to `1` if the collection is read-only, or `0` otherwise.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9102 * @param pathSize Number of levels in the path.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9103 * @param pathItems Items making the path.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9104 * @param payload The user payload.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9105 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9106 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9107 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9108 typedef OrthancPluginErrorCode (*OrthancPluginWebDavCreateFolderCallback) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9109 uint8_t* isReadOnly, /* out */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9110 uint32_t pathSize,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9111 const char* const* pathItems,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9112 void* payload);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9113
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9114
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9115 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9116 * @brief Callback to remove a file or a folder.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9117 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9118 * Signature of a callback function that removes a file or a folder
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9119 * from the WebDAV collection.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9120 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9121 * @param isReadOnly Pointer to a Boolean that must be set to `1` if the collection is read-only, or `0` otherwise.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9122 * @param pathSize Number of levels in the path.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9123 * @param pathItems Items making the path.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9124 * @param payload The user payload.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9125 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9126 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9127 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9128 typedef OrthancPluginErrorCode (*OrthancPluginWebDavDeleteItemCallback) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9129 uint8_t* isReadOnly, /* out */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9130 uint32_t pathSize,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9131 const char* const* pathItems,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9132 void* payload);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9133
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9134
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9135 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9136 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9137 const char* uri;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9138 OrthancPluginWebDavIsExistingFolderCallback isExistingFolder;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9139 OrthancPluginWebDavListFolderCallback listFolder;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9140 OrthancPluginWebDavRetrieveFileCallback retrieveFile;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9141 OrthancPluginWebDavStoreFileCallback storeFile;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9142 OrthancPluginWebDavCreateFolderCallback createFolder;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9143 OrthancPluginWebDavDeleteItemCallback deleteItem;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9144 void* payload;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9145 } _OrthancPluginRegisterWebDavCollection;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9146
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9147 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9148 * @brief Register a WebDAV virtual filesystem.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9149 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9150 * This function maps a WebDAV collection onto the given URI in the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9151 * REST API of Orthanc. This function must be called during the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9152 * initialization of the plugin, i.e. inside the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9153 * OrthancPluginInitialize() public function.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9154 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9155 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9156 * @param uri URI where to map the WebDAV collection (must start with a `/` character).
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9157 * @param isExistingFolder Callback method to test for the existence of a folder.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9158 * @param listFolder Callback method to list the content of a folder.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9159 * @param retrieveFile Callback method to retrieve the content of a file.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9160 * @param storeFile Callback method to store a file into the WebDAV collection.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9161 * @param createFolder Callback method to create a folder.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9162 * @param deleteItem Callback method to delete a file or a folder.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9163 * @param payload The user payload.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9164 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9165 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9166 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9167 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterWebDavCollection(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9168 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9169 const char* uri,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9170 OrthancPluginWebDavIsExistingFolderCallback isExistingFolder,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9171 OrthancPluginWebDavListFolderCallback listFolder,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9172 OrthancPluginWebDavRetrieveFileCallback retrieveFile,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9173 OrthancPluginWebDavStoreFileCallback storeFile,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9174 OrthancPluginWebDavCreateFolderCallback createFolder,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9175 OrthancPluginWebDavDeleteItemCallback deleteItem,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9176 void* payload)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9177 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9178 _OrthancPluginRegisterWebDavCollection params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9179 params.uri = uri;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9180 params.isExistingFolder = isExistingFolder;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9181 params.listFolder = listFolder;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9182 params.retrieveFile = retrieveFile;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9183 params.storeFile = storeFile;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9184 params.createFolder = createFolder;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9185 params.deleteItem = deleteItem;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9186 params.payload = payload;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9187
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9188 return context->InvokeService(context, _OrthancPluginService_RegisterWebDavCollection, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9189 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9190
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9191
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9192 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9193 * @brief Gets the DatabaseServerIdentifier.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9194 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9195 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9196 * @return the database server identifier. This is a statically-allocated
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9197 * string, do not free it.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9198 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9199 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9200 ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetDatabaseServerIdentifier(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9201 OrthancPluginContext* context)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9202 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9203 const char* result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9204
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9205 _OrthancPluginRetrieveStaticString params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9206 params.result = &result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9207 params.argument = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9208
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9209 if (context->InvokeService(context, _OrthancPluginService_GetDatabaseServerIdentifier, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9210 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9211 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9212 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9213 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9214 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9215 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9216 return result;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9217 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9218 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9219
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9220
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9221 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9222 * @brief Signature of a callback function that is triggered when
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9223 * the Orthanc core requests an operation from the database plugin.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9224 * Both request and response are encoded as protobuf buffers.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9225 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9226 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9227 typedef OrthancPluginErrorCode (*OrthancPluginCallDatabaseBackendV4) (
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9228 OrthancPluginMemoryBuffer64* response,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9229 void* backend,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9230 const void* request,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9231 uint64_t requestSize);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9232
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9233 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9234 * @brief Signature of a callback function that is triggered when
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9235 * the database plugin must be finalized.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9236 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9237 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9238 typedef void (*OrthancPluginFinalizeDatabaseBackendV4) (void* backend);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9239
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9240 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9241 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9242 void* backend;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9243 uint32_t maxDatabaseRetries;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9244 OrthancPluginCallDatabaseBackendV4 operations;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9245 OrthancPluginFinalizeDatabaseBackendV4 finalize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9246 } _OrthancPluginRegisterDatabaseBackendV4;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9247
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9248 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9249 * @brief Register a custom database back-end.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9250 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9251 * This function was added in Orthanc SDK 1.12.0. It uses Google
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9252 * Protocol Buffers for the communications between the Orthanc core
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9253 * and database plugins. Check out "OrthancDatabasePlugin.proto" for
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9254 * the definition of the protobuf messages.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9255 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9256 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9257 * @param backend Pointer to the custom database backend.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9258 * @param maxDatabaseRetries Maximum number of retries if transaction doesn't succeed.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9259 * If no retry is successful, OrthancPluginErrorCode_DatabaseCannotSerialize is generated.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9260 * @param operations Access to the operations of the custom database backend.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9261 * @param finalize Callback to deallocate the custom database backend.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9262 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9263 * @ingroup Callbacks
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9264 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9265 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDatabaseBackendV4(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9266 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9267 void* backend,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9268 uint32_t maxDatabaseRetries,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9269 OrthancPluginCallDatabaseBackendV4 operations,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9270 OrthancPluginFinalizeDatabaseBackendV4 finalize)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9271 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9272 _OrthancPluginRegisterDatabaseBackendV4 params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9273 params.backend = backend;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9274 params.maxDatabaseRetries = maxDatabaseRetries;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9275 params.operations = operations;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9276 params.finalize = finalize;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9277
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9278 return context->InvokeService(context, _OrthancPluginService_RegisterDatabaseBackendV4, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9279 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9280
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9281
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9282 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9283 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9284 OrthancPluginDicomInstance** target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9285 const char* instanceId;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9286 OrthancPluginLoadDicomInstanceMode mode;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9287 } _OrthancPluginLoadDicomInstance;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9288
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9289 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9290 * @brief Load a DICOM instance from the Orthanc server.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9291 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9292 * This function loads a DICOM instance from the content of the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9293 * Orthanc database. The function returns a new pointer to a data
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9294 * structure that is managed by the Orthanc core.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9295 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9296 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9297 * @param instanceId The Orthanc identifier of the DICOM instance of interest.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9298 * @param mode Flag specifying how to deal with pixel data.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9299 * @return The newly allocated DICOM instance. It must be freed with OrthancPluginFreeDicomInstance().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9300 * @ingroup DicomInstance
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9301 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9302 ORTHANC_PLUGIN_INLINE OrthancPluginDicomInstance* OrthancPluginLoadDicomInstance(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9303 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9304 const char* instanceId,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9305 OrthancPluginLoadDicomInstanceMode mode)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9306 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9307 OrthancPluginDicomInstance* target = NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9308
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9309 _OrthancPluginLoadDicomInstance params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9310 params.target = &target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9311 params.instanceId = instanceId;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9312 params.mode = mode;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9313
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9314 if (context->InvokeService(context, _OrthancPluginService_LoadDicomInstance, &params) != OrthancPluginErrorCode_Success)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9315 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9316 /* Error */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9317 return NULL;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9318 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9319 else
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9320 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9321 return target;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9322 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9323 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9324
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9325
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9326 typedef struct
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9327 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9328 const char* name;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9329 int64_t value;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9330 OrthancPluginMetricsType type;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9331 } _OrthancPluginSetMetricsIntegerValue;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9332
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9333 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9334 * @brief Set the value of an integer metrics.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9335 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9336 * This function sets the value of an integer metrics to monitor the
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9337 * behavior of the plugin through tools such as Prometheus. The
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9338 * values of all the metrics are stored within the Orthanc context.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9339 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9340 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9341 * @param name The name of the metrics to be set.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9342 * @param value The value of the metrics.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9343 * @param type The type of the metrics. This parameter is only taken into consideration
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9344 * the first time this metrics is set.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9345 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9346 * @see OrthancPluginSetMetricsValue()
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9347 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9348 ORTHANC_PLUGIN_INLINE void OrthancPluginSetMetricsIntegerValue(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9349 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9350 const char* name,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9351 int64_t value,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9352 OrthancPluginMetricsType type)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9353 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9354 _OrthancPluginSetMetricsIntegerValue params;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9355 params.name = name;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9356 params.value = value;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9357 params.type = type;
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9358 context->InvokeService(context, _OrthancPluginService_SetMetricsIntegerValue, &params);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9359 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9360
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9361
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9362 /**
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9363 * @brief Set the name of the current thread.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9364 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9365 * This function gives a name to the thread that is calling this
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9366 * function. This name is used in the Orthanc logs. This function
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9367 * must only be called from threads that the plugin has created
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9368 * itself.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9369 *
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9370 * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9371 * @param threadName The name of the current thread. A thread name cannot be longer than 16 characters.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9372 * @return 0 if success, other value if error.
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9373 * @ingroup Toolbox
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9374 **/
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9375 ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSetCurrentThreadName(
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9376 OrthancPluginContext* context,
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9377 const char* threadName)
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9378 {
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9379 return context->InvokeService(context, _OrthancPluginService_SetCurrentThreadName, threadName);
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9380 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9381
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9382 #ifdef __cplusplus
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9383 }
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9384 #endif
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9385
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9386
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9387 /** @} */
bba27bbef7e0 use Orthanc SDK 1.12.3
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9388