annotate OrthancCppClient/SharedLibrary/AUTOGENERATED/OrthancCppClient.h @ 1282:7bccdd221e2b

Plugins can do REST calls to other plugins
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 03 Feb 2015 11:52:21 +0100
parents 7f748bac15e5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Laaw - Lightweight, Automated API Wrapper
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2010-2013 Jomago - Alain Mazy, Benjamin Golinvaux,
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Sebastien Jodogne
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 *
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 * This program is free software: you can redistribute it and/or
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * modify it under the terms of the GNU General Public License as
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * published by the Free Software Foundation, either version 3 of the
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * License, or (at your option) any later version.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 *
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * In addition, as a special exception, the copyright holders of this
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * program give permission to link the code of its release with the
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * OpenSSL project's "OpenSSL" library (or with modified versions of it
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * that use the same license as the "OpenSSL" library), and distribute
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * the linked executables. You must obey the GNU General Public License
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * in all respects for all of the code used other than "OpenSSL". If you
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * modify file(s) with this exception, you may extend this exception to
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * your version of the file(s), but you are not obligated to do so. If
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * you do not wish to do so, delete this exception statement from your
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * version. If you delete this exception statement from all source files
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 * in the program, then also delete it here.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 *
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 * This program is distributed in the hope that it will be useful, but
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 * WITHOUT ANY WARRANTY; without even the implied warranty of
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 * General Public License for more details.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 *
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 * You should have received a copy of the GNU General Public License
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 * along with this program. If not, see <http://www.gnu.org/licenses/>.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 **/
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 /**
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 * @file
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 **/
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 #pragma once
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 #include <stdexcept>
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 #include <memory>
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 #include <string>
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 #include <string.h>
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 #if defined(_WIN32)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 /********************************************************************
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 ** This is the Windows-specific section
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 ********************************************************************/
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 #include <windows.h>
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 /* cf. http://sourceforge.net/p/predef/wiki/Architectures/ */
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 #ifdef _M_X64
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 /* 64 bits target */
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 #define LAAW_ORTHANC_CLIENT_CALL_CONV __fastcall
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 #define LAAW_ORTHANC_CLIENT_CALL_DECORATION(Name, StdCallSuffix) Name
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 #define LAAW_ORTHANC_CLIENT_DEFAULT_PATH "OrthancClient_Windows64.dll"
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 #else
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 /* 32 bits target */
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 #define LAAW_ORTHANC_CLIENT_CALL_CONV __stdcall
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 #define LAAW_ORTHANC_CLIENT_CALL_DECORATION(Name, StdCallSuffix) "_" Name "@" StdCallSuffix
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 #define LAAW_ORTHANC_CLIENT_DEFAULT_PATH "OrthancClient_Windows32.dll"
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 #endif
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 #define LAAW_ORTHANC_CLIENT_HANDLE_TYPE HINSTANCE
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 #define LAAW_ORTHANC_CLIENT_HANDLE_NULL 0
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 #define LAAW_ORTHANC_CLIENT_FUNCTION_TYPE FARPROC
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 #define LAAW_ORTHANC_CLIENT_LOADER(path) LoadLibraryA(path)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 #define LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle, name, decoration) GetProcAddress(handle, LAAW_ORTHANC_CLIENT_CALL_DECORATION(name, decoration))
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 #define LAAW_ORTHANC_CLIENT_CLOSER(handle) FreeLibrary(handle)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 /********************************************************************
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 ** This is the Linux-specific section
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 ********************************************************************/
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 #elif defined (__linux)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 #include <stdlib.h>
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 #include <dlfcn.h>
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 /* cf. http://sourceforge.net/p/predef/wiki/Architectures/ */
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 #ifdef __amd64__
1034
7f748bac15e5 set version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 990
diff changeset
84 #define LAAW_ORTHANC_CLIENT_DEFAULT_PATH "libOrthancClient.so.0.8"
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 #else
1034
7f748bac15e5 set version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 990
diff changeset
86 #define LAAW_ORTHANC_CLIENT_DEFAULT_PATH "libOrthancClient.so.0.8"
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 #endif
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 #define LAAW_ORTHANC_CLIENT_CALL_CONV
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 #define LAAW_ORTHANC_CLIENT_HANDLE_TYPE void*
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 #define LAAW_ORTHANC_CLIENT_HANDLE_NULL NULL
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 #define LAAW_ORTHANC_CLIENT_FUNCTION_TYPE intptr_t
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 #define LAAW_ORTHANC_CLIENT_LOADER(path) dlopen(path, RTLD_LAZY)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 #define LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle, name, decoration) (LAAW_ORTHANC_CLIENT_FUNCTION_TYPE) dlsym(handle, name)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 #define LAAW_ORTHANC_CLIENT_CLOSER(handle) dlclose(handle)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 #else
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 #error Please support your platform here
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 #endif
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 /********************************************************************
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 ** Definition of the integer types
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 ********************************************************************/
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 #ifndef LAAW_INT8 // Only define the integer types once
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 #if defined(__GNUC__)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 // Under GCC (including MinGW), the stdint.h standard header is used.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 #include <stdint.h>
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 #define LAAW_INT8 int8_t
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 #define LAAW_UINT8 uint8_t
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 #define LAAW_INT16 int16_t
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 #define LAAW_UINT16 uint16_t
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 #define LAAW_INT32 int32_t
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120 #define LAAW_UINT32 uint32_t
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 #define LAAW_INT64 int64_t
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 #define LAAW_UINT64 uint64_t
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 #elif defined(_MSC_VER)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 // Under Visual Studio, it is required to define the various integer
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 // types by hand.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 #if (_MSC_VER < 1300)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 typedef signed char LAAW_INT8;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 typedef signed short LAAW_INT16;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 typedef signed int LAAW_INT32;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 typedef unsigned char LAAW_UINT8;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 typedef unsigned short LAAW_UINT16;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 typedef unsigned int LAAW_UINT32;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 #else
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 typedef signed __int8 LAAW_INT8;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 typedef signed __int16 LAAW_INT16;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 typedef signed __int32 LAAW_INT32;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 typedef unsigned __int8 LAAW_UINT8;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 typedef unsigned __int16 LAAW_UINT16;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 typedef unsigned __int32 LAAW_UINT32;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143 #endif
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 typedef signed __int64 LAAW_INT64;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 typedef unsigned __int64 LAAW_UINT64;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 #else
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 #error "Please support your compiler here"
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 #endif
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 #endif
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 /********************************************************************
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 ** This is a shared section between Windows and Linux
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 ********************************************************************/
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 namespace OrthancClient {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 /**
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 * @brief Exception class that is thrown by the functions of this shared library.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 **/
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 class OrthancClientException : public std::exception
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 private:
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 std::string message_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 public:
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 /**
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173 * @brief Constructs an exception.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 * @param message The error message.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 **/
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 OrthancClientException(std::string message) : message_(message)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180 ~OrthancClientException() throw()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184 /**
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
185 * @brief Get the error message associated with this exception.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186 * @returns The error message.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 **/
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188 const std::string& What() const throw()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190 return message_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 };
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196 namespace OrthancClient { namespace Internals {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197 /**
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 * This internal class implements a Singleton design pattern that will
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 * store a reference to the shared library handle, together with a
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 * pointer to each function in the shared library.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201 **/
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202 class Library
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 private:
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205 LAAW_ORTHANC_CLIENT_HANDLE_TYPE handle_;
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
206 LAAW_ORTHANC_CLIENT_FUNCTION_TYPE functionsIndex_[63 + 1];
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210 void Load(const char* sharedLibraryPath)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213 if (handle_ != LAAW_ORTHANC_CLIENT_HANDLE_NULL)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215 // Do nothing if the library is already loaded
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216 return;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219 /* Setup the path to the default shared library if not provided */
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220 if (sharedLibraryPath == NULL)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222 sharedLibraryPath = LAAW_ORTHANC_CLIENT_DEFAULT_PATH;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225 /* Load the shared library */
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226 handle_ = LAAW_ORTHANC_CLIENT_LOADER(sharedLibraryPath);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
227
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229 if (handle_ == LAAW_ORTHANC_CLIENT_HANDLE_NULL)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
230 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
231 throw ::OrthancClient::OrthancClientException("Error loading shared library");
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
232 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
233
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
234 LoadFunctions();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
235 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
236
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
237 inline void LoadFunctions();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
238
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
239 void FreeString(char* str)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
240 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
241 typedef void (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (char*);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
242 Function function = (Function) GetFunction(63);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
243 function(str);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
244 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
245
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
246 Library()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
247 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
248 handle_ = LAAW_ORTHANC_CLIENT_HANDLE_NULL;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
249 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
250
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
251 ~Library()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
252 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
253 Finalize();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
254 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
255
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
256 public:
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
257 LAAW_ORTHANC_CLIENT_FUNCTION_TYPE GetFunction(unsigned int index)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
258 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
259 /**
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
260 * If the library has not been manually initialized by a call to
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
261 * ::OrthancClient::Initialize(), it is loaded from
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
262 * the default location (lazy initialization).
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
263 **/
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
264 if (handle_ == NULL)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
265 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
266 Load(NULL);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
267 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
268
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
269 return functionsIndex_[index];
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
270 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
271
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
272 void ThrowExceptionIfNeeded(char* message)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
273 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
274 if (message != NULL)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
275 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
276 std::string tmp(message);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
277 FreeString(message);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
278 throw ::OrthancClient::OrthancClientException(tmp);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
279 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
280 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
281
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
282 static inline Library& GetInstance()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
283 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
284 /**
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
285 * This function defines a "static variable" inside a "static
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
286 * inline method" of a class. This ensures that a single
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
287 * instance of this variable will be used across all the
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
288 * compilation modules of the software.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
289 * http://stackoverflow.com/a/1389403/881731
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
290 **/
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
291
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
292 static Library singleton;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
293 return singleton;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
294 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
295
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
296 static void Initialize(const char* sharedLibraryPath)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
297 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
298 GetInstance().Load(sharedLibraryPath);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
299 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
300
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
301 void Finalize()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
302 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
303 if (handle_ != LAAW_ORTHANC_CLIENT_HANDLE_NULL)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
304 {
990
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 986
diff changeset
305 #if 0
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 986
diff changeset
306 /**
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 986
diff changeset
307 * Do not explicitly unload the shared library, as it might
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 986
diff changeset
308 * interfere with the destruction of static objects declared
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 986
diff changeset
309 * inside the library (e.g. this is the case of gflags that is
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 986
diff changeset
310 * internally used by googlelog).
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 986
diff changeset
311 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
312 LAAW_ORTHANC_CLIENT_CLOSER(handle_);
990
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 986
diff changeset
313 #endif
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
314 handle_ = LAAW_ORTHANC_CLIENT_HANDLE_NULL;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
315 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
316 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
317 };
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
318 }}
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
319
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
320
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
321 /*!
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
322 * \addtogroup Global Global definitions.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
323 * @{
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
324 * @}
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
325 */
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
326
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
327
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
328 namespace OrthancClient {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
329 /*!
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
330 * \addtogroup Initialization Initialization of the shared library.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
331 * @{
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
332 */
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
333
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
334 /**
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
335 * @brief Manually initialize the shared library, using the default library name.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
336 *
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
337 * Call this method before using the library to ensure correct
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
338 * behaviour in multi-threaded applications. This method is also
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
339 * useful to control the time at which the shared library is
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
340 * loaded (e.g. for real-time applications).
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
341 **/
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
342 inline void Initialize()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
343 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
344 ::OrthancClient::Internals::Library::Initialize(NULL);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
345 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
346
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
347 /**
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
348 * @brief Manually initialize the shared library.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
349 *
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
350 * Call this method before using the library to ensure correct
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
351 * behaviour in multi-threaded applications. This method is also
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
352 * useful to control the time at which the shared library is
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
353 * loaded (e.g. for real-time applications).
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
354 *
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
355 * @param sharedLibraryPath The path to the shared library that
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
356 * contains the module.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
357 **/
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
358 inline void Initialize(const std::string& sharedLibraryPath)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
359 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
360 ::OrthancClient::Internals::Library::Initialize(sharedLibraryPath.c_str());
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
361 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
362
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
363 /**
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
364 * @brief Manually finalize the shared library.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
365 *
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
366 * Calling explicitly this function is not mandatory. It is useful to
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
367 * force the release of the resources acquired by the shared library,
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
368 * or to manually control the order in which the global variables get
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
369 * deleted.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
370 **/
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
371 inline void Finalize()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
372 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
373 ::OrthancClient::Internals::Library::GetInstance().Finalize();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
374 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
375
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
376
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
377 /**
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
378 * @}
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
379 */
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
380 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
381
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
382
660
f0232774b913 fix warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 657
diff changeset
383 namespace OrthancClient { namespace Internals {
f0232774b913 fix warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 657
diff changeset
384 inline void Library::LoadFunctions()
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
385 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
386 typedef const char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) ();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
387 Function getVersion = (Function) LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_GetVersion", "0");
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
388 if (getVersion == NULL)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
389 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
390 throw ::OrthancClient::OrthancClientException("Unable to get the library version");
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
391 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
392
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
393 /**
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
394 * It is assumed that the API does not change when the revision
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
395 * number (MAJOR.MINOR.REVISION) changes.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
396 **/
1034
7f748bac15e5 set version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 990
diff changeset
397 if (strcmp(getVersion(), "0.8"))
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
398 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
399 throw ::OrthancClient::OrthancClientException("Mismatch between the C++ header and the library version");
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
400 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
401
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
402 functionsIndex_[63] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_FreeString", "4");
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
403 functionsIndex_[3] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_557aee7b61817292a0f31269d3c35db7", "8");
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
404 functionsIndex_[4] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_0b8dff0ce67f10954a49b059e348837e", "8");
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
405 functionsIndex_[5] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_e05097c153f676e5a5ee54dcfc78256f", "4");
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
406 functionsIndex_[6] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_e840242bf58d17d3c1d722da09ce88e0", "8");
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
407 functionsIndex_[7] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_c9af31433001b5dfc012a552dc6d0050", "8");
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
408 functionsIndex_[8] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_3fba4d6b818180a44cd1cae6046334dc", "12");
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
409 functionsIndex_[9] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_aeb20dc75b9246188db857317e5e0ce7", "8");
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
410 functionsIndex_[10] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_62689803d9871e4d9c51a648640b320b", "8");
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
411 functionsIndex_[11] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_2fb64c9e5a67eccd413b0e913469a421", "16");
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
412 functionsIndex_[0] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_1f1acb322ea4d0aad65172824607673c", "8");
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
413 functionsIndex_[1] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_f3fd272e4636f6a531aabb72ee01cd5b", "16");
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
414 functionsIndex_[2] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_12d3de0a96e9efb11136a9811bb9ed38", "4");
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
415 functionsIndex_[14] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_f756172daf04516eec3a566adabb4335", "4");
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
416 functionsIndex_[15] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_ddb68763ec902a97d579666a73a20118", "8");
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
417 functionsIndex_[16] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_fba3c68b4be7558dbc65f7ce1ab57d63", "12");
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
418 functionsIndex_[17] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_b4ca99d958f843493e58d1ef967340e1", "8");
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
419 functionsIndex_[18] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_78d5cc76d282437b6f93ec3b82c35701", "16");
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
420 functionsIndex_[12] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_6cf0d7268667f9b0aa4511bacf184919", "12");
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
421 functionsIndex_[13] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_7d81cd502ee27e859735d0ea7112b5a1", "4");
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
422 functionsIndex_[21] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_48a2a1a9d68c047e22bfba23014643d2", "4");
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
423 functionsIndex_[22] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_852bf8296ca21c5fde5ec565cc10721d", "8");
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
424 functionsIndex_[23] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_efd04574e0779faa83df1f2d8f9888db", "12");
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
425 functionsIndex_[24] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_736247ff5e8036dac38163da6f666ed5", "8");
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
426 functionsIndex_[25] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_d82d2598a7a73f4b6fcc0c09c25b08ca", "8");
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
427 functionsIndex_[26] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_88134b978f9acb2aecdadf54aeab3c64", "16");
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
428 functionsIndex_[27] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_152cb1b704c053d24b0dab7461ba6ea3", "8");
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
429 functionsIndex_[28] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_eee03f337ec81d9f1783cd41e5238757", "8");
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
430 functionsIndex_[29] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_006f08237bd7611636fc721baebfb4c5", "8");
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
431 functionsIndex_[30] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_b794f5cd3dad7d7b575dd1fd902afdd0", "8");
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
432 functionsIndex_[31] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_8ee2e50dd9df8f66a3c1766090dd03ab", "8");
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
433 functionsIndex_[32] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_046aed35bbe4751691f4c34cc249a61d", "8");
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
434 functionsIndex_[33] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_2be452e7af5bf7dfd8c5021842674497", "8");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
435 functionsIndex_[34] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_4dcc7a0fd025efba251ac6e9b701c2c5", "28");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
436 functionsIndex_[35] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_b2601a161c24ad0a1d3586246f87452c", "32");
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
437 functionsIndex_[19] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_193599b9e345384fcdfcd47c29c55342", "12");
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
438 functionsIndex_[20] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_7c97f17063a357d38c5fab1136ad12a0", "4");
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
439 functionsIndex_[38] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_e65b20b7e0170b67544cd6664a4639b7", "4");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
440 functionsIndex_[39] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_470e981b0e41f17231ba0ae6f3033321", "8");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
441 functionsIndex_[40] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_04cefd138b6ea15ad909858f2a0a8f05", "12");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
442 functionsIndex_[41] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_aee5b1f6f0c082f2c3b0986f9f6a18c7", "8");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
443 functionsIndex_[42] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_93965682bace75491413e1f0b8d5a654", "16");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
444 functionsIndex_[36] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_b01c6003238eb46c8db5dc823d7ca678", "12");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
445 functionsIndex_[37] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_0147007fb99bad8cd95a139ec8795376", "4");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
446 functionsIndex_[45] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_236ee8b403bc99535a8a4695c0cd45cb", "8");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
447 functionsIndex_[46] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_2a437b7aba6bb01e81113835be8f0146", "8");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
448 functionsIndex_[47] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_2bcbcb850934ae0bb4c6f0cc940e6cda", "8");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
449 functionsIndex_[48] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_8d415c3a78a48e7e61d9fd24e7c79484", "12");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
450 functionsIndex_[49] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_70d2f8398bbc63b5f792b69b4ad5fecb", "12");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
451 functionsIndex_[50] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_1729a067d902771517388eedd7346b23", "12");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
452 functionsIndex_[51] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_72e2aeee66cd3abd8ab7e987321c3745", "8");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
453 functionsIndex_[52] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_1ea3df5a1ac1a1a687fe7325adddb6f0", "8");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
454 functionsIndex_[53] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_99b4f370e4f532d8b763e2cb49db92f8", "8");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
455 functionsIndex_[54] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_c41c742b68617f1c0590577a0a5ebc0c", "8");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
456 functionsIndex_[55] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_142dd2feba0fc1d262bbd0baeb441a8b", "8");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
457 functionsIndex_[56] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_5f5c9f81a4dff8daa6c359f1d0488fef", "12");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
458 functionsIndex_[57] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_9ca979fffd08fa256306d4e68d8b0e91", "8");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
459 functionsIndex_[58] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_6f2d77a26edc91c28d89408dbc3c271e", "8");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
460 functionsIndex_[59] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_c0f494b80d4ff8b232df7a75baa0700a", "4");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
461 functionsIndex_[60] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_d604f44bd5195e082e745e9cbc164f4c", "4");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
462 functionsIndex_[61] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_1710299d1c5f3b1f2b7cf3962deebbfd", "8");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
463 functionsIndex_[62] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_bb55aaf772ddceaadee36f4e54136bcb", "8");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
464 functionsIndex_[43] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_6c5ad02f91b583e29cebd0bd319ce21d", "12");
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
465 functionsIndex_[44] = LAAW_ORTHANC_CLIENT_GET_FUNCTION(handle_, "LAAW_EXTERNC_4068241c44a9c1367fe0e57be523f207", "4");
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
466
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
467 /* Check whether the functions were properly loaded */
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
468 for (unsigned int i = 0; i <= 63; i++)
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
469 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
470 if (functionsIndex_[i] == (LAAW_ORTHANC_CLIENT_FUNCTION_TYPE) NULL)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
471 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
472 throw ::OrthancClient::OrthancClientException("Unable to load the functions of the shared library");
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
473 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
474 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
475 }
660
f0232774b913 fix warnings
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 657
diff changeset
476 }}
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
477 namespace OrthancClient
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
478 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
479 class OrthancConnection;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
480 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
481
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
482 namespace OrthancClient
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
483 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
484 class Patient;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
485 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
486
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
487 namespace OrthancClient
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
488 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
489 class Series;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
490 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
491
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
492 namespace OrthancClient
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
493 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
494 class Study;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
495 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
496
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
497 namespace OrthancClient
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
498 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
499 class Instance;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
500 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
501
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
502 namespace Orthanc
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
503 {
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
504 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
505 * @brief The memory layout of the pixels (resp. voxels) of a 2D (resp. 3D) image.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
506 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
507 * The memory layout of the pixels (resp. voxels) of a 2D (resp. 3D) image.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
508 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
509 * @ingroup Global
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
510 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
511 enum PixelFormat
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
512 {
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
513 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
514 * @brief Graylevel, signed 16bpp image.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
515 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
516 * The image is graylevel. Each pixel is signed and stored in two bytes.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
517 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
518 **/
865
f2841a9e04cf force enumeration values in c++ client
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 820
diff changeset
519 PixelFormat_SignedGrayscale16 = 5,
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
520 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
521 * @brief Color image in RGB24 format.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
522 *
865
f2841a9e04cf force enumeration values in c++ client
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 820
diff changeset
523 * This format describes a color image. The pixels are stored in 3 consecutive bytes. The memory layout is RGB.
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
524 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
525 **/
865
f2841a9e04cf force enumeration values in c++ client
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 820
diff changeset
526 PixelFormat_RGB24 = 1,
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
527 /**
820
55bce9b55054 set version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 728
diff changeset
528 * @brief Color image in RGBA32 format.
55bce9b55054 set version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 728
diff changeset
529 *
865
f2841a9e04cf force enumeration values in c++ client
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 820
diff changeset
530 * This format describes a color image. The pixels are stored in 4 consecutive bytes. The memory layout is RGBA.
820
55bce9b55054 set version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 728
diff changeset
531 *
55bce9b55054 set version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 728
diff changeset
532 **/
865
f2841a9e04cf force enumeration values in c++ client
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 820
diff changeset
533 PixelFormat_RGBA32 = 2,
820
55bce9b55054 set version
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 728
diff changeset
534 /**
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
535 * @brief Graylevel 8bpp image.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
536 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
537 * The image is graylevel. Each pixel is unsigned and stored in one byte.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
538 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
539 **/
865
f2841a9e04cf force enumeration values in c++ client
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 820
diff changeset
540 PixelFormat_Grayscale8 = 3,
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
541 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
542 * @brief Graylevel, unsigned 16bpp image.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
543 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
544 * The image is graylevel. Each pixel is unsigned and stored in two bytes.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
545 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
546 **/
865
f2841a9e04cf force enumeration values in c++ client
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 820
diff changeset
547 PixelFormat_Grayscale16 = 4
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
548 };
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
549 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
550
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
551 namespace Orthanc
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
552 {
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
553 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
554 * @brief The extraction mode specifies the way the values of the pixels are scaled when downloading a 2D image.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
555 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
556 * The extraction mode specifies the way the values of the pixels are scaled when downloading a 2D image.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
557 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
558 * @ingroup Global
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
559 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
560 enum ImageExtractionMode
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
561 {
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
562 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
563 * @brief Truncation to the [-32768, 32767] range.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
564 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
565 * Truncation to the [-32768, 32767] range.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
566 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
567 **/
865
f2841a9e04cf force enumeration values in c++ client
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 820
diff changeset
568 ImageExtractionMode_Int16 = 4,
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
569 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
570 * @brief Rescaled to 8bpp.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
571 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
572 * The minimum value of the image is set to 0, and its maximum value is set to 255.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
573 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
574 **/
865
f2841a9e04cf force enumeration values in c++ client
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 820
diff changeset
575 ImageExtractionMode_Preview = 1,
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
576 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
577 * @brief Truncation to the [0, 255] range.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
578 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
579 * Truncation to the [0, 255] range.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
580 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
581 **/
865
f2841a9e04cf force enumeration values in c++ client
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 820
diff changeset
582 ImageExtractionMode_UInt8 = 2,
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
583 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
584 * @brief Truncation to the [0, 65535] range.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
585 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
586 * Truncation to the [0, 65535] range.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
587 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
588 **/
865
f2841a9e04cf force enumeration values in c++ client
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 820
diff changeset
589 ImageExtractionMode_UInt16 = 3
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
590 };
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
591 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
592
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
593 namespace OrthancClient
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
594 {
573
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
595 /**
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
596 * @brief Connection to an instance of %Orthanc.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
597 *
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
598 * This class encapsulates a connection to a remote instance of %Orthanc through its REST API.
573
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
599 *
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
600 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
601 class OrthancConnection
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
602 {
573
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
603 friend class ::OrthancClient::Patient;
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
604 friend class ::OrthancClient::Series;
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
605 friend class ::OrthancClient::Study;
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
606 friend class ::OrthancClient::Instance;
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
607 private:
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
608 bool isReference_;
591
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
609 OrthancConnection& operator= (const OrthancConnection&); // Assignment is forbidden
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
610 void* pimpl_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
611 OrthancConnection(void* pimpl) : isReference_(true), pimpl_(pimpl) {}
588
a0001c222b32 refactoring of samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 575
diff changeset
612 public:
591
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
613 /**
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
614 * @brief Construct a new reference to this object.
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
615 *
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
616 * Construct a new reference to this object. Pay attention to the fact that when the referenced object is deleted, the content of this object will be invalid.
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
617 *
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
618 * @param other The original object.
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
619 **/
657
5425bb6f1ea5 further cppcheck fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 629
diff changeset
620 OrthancConnection(const OrthancConnection& other) : isReference_(true), pimpl_(other.pimpl_) { }
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
621 inline OrthancConnection(const ::std::string& orthancUrl);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
622 inline OrthancConnection(const ::std::string& orthancUrl, const ::std::string& username, const ::std::string& password);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
623 inline ~OrthancConnection();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
624 inline LAAW_UINT32 GetThreadCount() const;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
625 inline void SetThreadCount(LAAW_UINT32 threadCount);
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
626 inline void Reload();
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
627 inline ::std::string GetOrthancUrl() const;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
628 inline LAAW_UINT32 GetPatientCount();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
629 inline ::OrthancClient::Patient GetPatient(LAAW_UINT32 index);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
630 inline void DeletePatient(LAAW_UINT32 index);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
631 inline void StoreFile(const ::std::string& filename);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
632 inline void Store(const void* dicom, LAAW_UINT64 size);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
633 };
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
634 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
635
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
636 namespace OrthancClient
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
637 {
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
638 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
639 * @brief Connection to a patient stored in %Orthanc.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
640 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
641 * This class encapsulates a connection to a patient from a remote instance of %Orthanc.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
642 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
643 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
644 class Patient
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
645 {
573
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
646 friend class ::OrthancClient::OrthancConnection;
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
647 friend class ::OrthancClient::Series;
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
648 friend class ::OrthancClient::Study;
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
649 friend class ::OrthancClient::Instance;
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
650 private:
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
651 bool isReference_;
591
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
652 Patient& operator= (const Patient&); // Assignment is forbidden
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
653 void* pimpl_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
654 Patient(void* pimpl) : isReference_(true), pimpl_(pimpl) {}
588
a0001c222b32 refactoring of samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 575
diff changeset
655 public:
591
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
656 /**
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
657 * @brief Construct a new reference to this object.
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
658 *
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
659 * Construct a new reference to this object. Pay attention to the fact that when the referenced object is deleted, the content of this object will be invalid.
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
660 *
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
661 * @param other The original object.
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
662 **/
657
5425bb6f1ea5 further cppcheck fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 629
diff changeset
663 Patient(const Patient& other) : isReference_(true), pimpl_(other.pimpl_) { }
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
664 inline Patient(::OrthancClient::OrthancConnection& connection, const ::std::string& id);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
665 inline ~Patient();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
666 inline void Reload();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
667 inline LAAW_UINT32 GetStudyCount();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
668 inline ::OrthancClient::Study GetStudy(LAAW_UINT32 index);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
669 inline ::std::string GetId() const;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
670 inline ::std::string GetMainDicomTag(const ::std::string& tag, const ::std::string& defaultValue) const;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
671 };
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
672 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
673
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
674 namespace OrthancClient
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
675 {
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
676 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
677 * @brief Connection to a series stored in %Orthanc.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
678 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
679 * This class encapsulates a connection to a series from a remote instance of %Orthanc.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
680 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
681 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
682 class Series
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
683 {
573
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
684 friend class ::OrthancClient::OrthancConnection;
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
685 friend class ::OrthancClient::Patient;
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
686 friend class ::OrthancClient::Study;
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
687 friend class ::OrthancClient::Instance;
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
688 private:
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
689 bool isReference_;
591
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
690 Series& operator= (const Series&); // Assignment is forbidden
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
691 void* pimpl_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
692 Series(void* pimpl) : isReference_(true), pimpl_(pimpl) {}
588
a0001c222b32 refactoring of samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 575
diff changeset
693 public:
591
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
694 /**
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
695 * @brief Construct a new reference to this object.
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
696 *
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
697 * Construct a new reference to this object. Pay attention to the fact that when the referenced object is deleted, the content of this object will be invalid.
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
698 *
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
699 * @param other The original object.
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
700 **/
657
5425bb6f1ea5 further cppcheck fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 629
diff changeset
701 Series(const Series& other) : isReference_(true), pimpl_(other.pimpl_) { }
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
702 inline Series(::OrthancClient::OrthancConnection& connection, const ::std::string& id);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
703 inline ~Series();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
704 inline void Reload();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
705 inline LAAW_UINT32 GetInstanceCount();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
706 inline ::OrthancClient::Instance GetInstance(LAAW_UINT32 index);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
707 inline ::std::string GetId() const;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
708 inline ::std::string GetUrl() const;
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
709 inline ::std::string GetMainDicomTag(const ::std::string& tag, const ::std::string& defaultValue) const;
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
710 inline bool Is3DImage();
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
711 inline LAAW_UINT32 GetWidth();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
712 inline LAAW_UINT32 GetHeight();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
713 inline float GetVoxelSizeX();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
714 inline float GetVoxelSizeY();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
715 inline float GetVoxelSizeZ();
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
716 inline float GetSliceThickness();
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
717 inline void Load3DImage(void* target, ::Orthanc::PixelFormat format, LAAW_INT64 lineStride, LAAW_INT64 stackStride);
548
ffedcc8f0938 progress
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 540
diff changeset
718 inline void Load3DImage(void* target, ::Orthanc::PixelFormat format, LAAW_INT64 lineStride, LAAW_INT64 stackStride, float progress[]);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
719 };
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
720 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
721
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
722 namespace OrthancClient
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
723 {
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
724 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
725 * @brief Connection to a study stored in %Orthanc.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
726 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
727 * This class encapsulates a connection to a study from a remote instance of %Orthanc.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
728 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
729 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
730 class Study
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
731 {
573
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
732 friend class ::OrthancClient::OrthancConnection;
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
733 friend class ::OrthancClient::Patient;
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
734 friend class ::OrthancClient::Series;
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
735 friend class ::OrthancClient::Instance;
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
736 private:
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
737 bool isReference_;
591
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
738 Study& operator= (const Study&); // Assignment is forbidden
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
739 void* pimpl_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
740 Study(void* pimpl) : isReference_(true), pimpl_(pimpl) {}
588
a0001c222b32 refactoring of samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 575
diff changeset
741 public:
591
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
742 /**
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
743 * @brief Construct a new reference to this object.
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
744 *
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
745 * Construct a new reference to this object. Pay attention to the fact that when the referenced object is deleted, the content of this object will be invalid.
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
746 *
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
747 * @param other The original object.
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
748 **/
657
5425bb6f1ea5 further cppcheck fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 629
diff changeset
749 Study(const Study& other) : isReference_(true), pimpl_(other.pimpl_) { }
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
750 inline Study(::OrthancClient::OrthancConnection& connection, const ::std::string& id);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
751 inline ~Study();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
752 inline void Reload();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
753 inline LAAW_UINT32 GetSeriesCount();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
754 inline ::OrthancClient::Series GetSeries(LAAW_UINT32 index);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
755 inline ::std::string GetId() const;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
756 inline ::std::string GetMainDicomTag(const ::std::string& tag, const ::std::string& defaultValue) const;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
757 };
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
758 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
759
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
760 namespace OrthancClient
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
761 {
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
762 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
763 * @brief Connection to an instance stored in %Orthanc.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
764 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
765 * This class encapsulates a connection to an image instance from a remote instance of %Orthanc.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
766 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
767 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
768 class Instance
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
769 {
573
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
770 friend class ::OrthancClient::OrthancConnection;
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
771 friend class ::OrthancClient::Patient;
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
772 friend class ::OrthancClient::Series;
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
773 friend class ::OrthancClient::Study;
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
774 private:
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
775 bool isReference_;
591
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
776 Instance& operator= (const Instance&); // Assignment is forbidden
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
777 void* pimpl_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
778 Instance(void* pimpl) : isReference_(true), pimpl_(pimpl) {}
588
a0001c222b32 refactoring of samples
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 575
diff changeset
779 public:
591
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
780 /**
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
781 * @brief Construct a new reference to this object.
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
782 *
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
783 * Construct a new reference to this object. Pay attention to the fact that when the referenced object is deleted, the content of this object will be invalid.
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
784 *
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
785 * @param other The original object.
a00f626290db better api
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 588
diff changeset
786 **/
657
5425bb6f1ea5 further cppcheck fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 629
diff changeset
787 Instance(const Instance& other) : isReference_(true), pimpl_(other.pimpl_) { }
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
788 inline Instance(::OrthancClient::OrthancConnection& connection, const ::std::string& id);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
789 inline ~Instance();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
790 inline ::std::string GetId() const;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
791 inline void SetImageExtractionMode(::Orthanc::ImageExtractionMode mode);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
792 inline ::Orthanc::ImageExtractionMode GetImageExtractionMode() const;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
793 inline ::std::string GetTagAsString(const ::std::string& tag) const;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
794 inline float GetTagAsFloat(const ::std::string& tag) const;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
795 inline LAAW_INT32 GetTagAsInt(const ::std::string& tag) const;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
796 inline LAAW_UINT32 GetWidth();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
797 inline LAAW_UINT32 GetHeight();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
798 inline LAAW_UINT32 GetPitch();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
799 inline ::Orthanc::PixelFormat GetPixelFormat();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
800 inline const void* GetBuffer();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
801 inline const void* GetBuffer(LAAW_UINT32 y);
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
802 inline LAAW_UINT64 GetDicomSize();
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
803 inline const void* GetDicom();
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
804 inline void DiscardImage();
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
805 inline void DiscardDicom();
728
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
806 inline void LoadTagContent(const ::std::string& path);
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
807 inline ::std::string GetLoadedTagContent() const;
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
808 };
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
809 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
810
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
811 namespace OrthancClient
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
812 {
573
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
813 /**
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
814 * @brief Create a connection to an instance of %Orthanc.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
815 *
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
816 * Create a connection to an instance of %Orthanc.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
817 *
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
818 * @param orthancUrl URL to which the REST API of %Orthanc is listening.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
819 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
820 inline OrthancConnection::OrthancConnection(const ::std::string& orthancUrl)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
821 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
822 isReference_ = false;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
823 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void**, const char*);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
824 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(0);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
825 char* error = function(&pimpl_, orthancUrl.c_str());
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
826 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
827 }
573
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
828 /**
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
829 * @brief Create a connection to an instance of %Orthanc, with authentication.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
830 *
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
831 * Create a connection to an instance of %Orthanc, with authentication.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
832 *
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
833 * @param orthancUrl URL to which the REST API of %Orthanc is listening.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
834 * @param username The username.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
835 * @param password The password.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
836 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
837 inline OrthancConnection::OrthancConnection(const ::std::string& orthancUrl, const ::std::string& username, const ::std::string& password)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
838 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
839 isReference_ = false;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
840 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void**, const char*, const char*, const char*);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
841 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(1);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
842 char* error = function(&pimpl_, orthancUrl.c_str(), username.c_str(), password.c_str());
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
843 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
844 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
845 /**
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
846 * @brief Destructs the object.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
847 *
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
848 * Destructs the object.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
849 *
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
850 **/
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
851 inline OrthancConnection::~OrthancConnection()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
852 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
853 if (isReference_) return;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
854 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
855 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(2);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
856 char* error = function(pimpl_);
657
5425bb6f1ea5 further cppcheck fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 629
diff changeset
857 error = error; // Remove warning about unused variable
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
858 }
573
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
859 /**
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
860 * @brief Returns the number of threads for this connection.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
861 *
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
862 * Returns the number of simultaneous connections that are used when downloading information from this instance of %Orthanc.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
863 *
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
864 * @return The number of threads.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
865 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
866 inline LAAW_UINT32 OrthancConnection::GetThreadCount() const
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
867 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
868 LAAW_UINT32 result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
869 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (const void*, LAAW_UINT32*);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
870 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(3);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
871 char* error = function(pimpl_, &result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
872 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
873 return result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
874 }
573
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
875 /**
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
876 * @brief Sets the number of threads for this connection.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
877 *
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
878 * Sets the number of simultaneous connections that are used when downloading information from this instance of %Orthanc.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
879 *
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
880 * @param threadCount The number of threads.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
881 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
882 inline void OrthancConnection::SetThreadCount(LAAW_UINT32 threadCount)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
883 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
884 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, LAAW_UINT32);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
885 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(4);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
886 char* error = function(pimpl_, threadCount);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
887 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
888 }
573
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
889 /**
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
890 * @brief Reload the list of the patients.
573
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
891 *
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
892 * This method will reload the list of the patients from the remote instance of %Orthanc. Pay attention to the fact that the patients that have been previously returned by GetPatient() will be invalidated.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
893 *
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
894 **/
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
895 inline void OrthancConnection::Reload()
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
896 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
897 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
898 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(5);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
899 char* error = function(pimpl_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
900 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
901 }
573
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
902 /**
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
903 * @brief Returns the URL of this instance of %Orthanc.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
904 *
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
905 * Returns the URL of the remote %Orthanc instance to which this object is connected.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
906 *
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
907 * @return The URL.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
908 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
909 inline ::std::string OrthancConnection::GetOrthancUrl() const
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
910 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
911 const char* result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
912 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (const void*, const char**);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
913 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(6);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
914 char* error = function(pimpl_, &result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
915 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
916 return std::string(result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
917 }
573
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
918 /**
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
919 * @brief Returns the number of patients.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
920 *
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
921 * Returns the number of patients that are stored in the remote instance of %Orthanc.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
922 *
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
923 * @return The number of patients.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
924 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
925 inline LAAW_UINT32 OrthancConnection::GetPatientCount()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
926 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
927 LAAW_UINT32 result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
928 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, LAAW_UINT32*);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
929 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(7);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
930 char* error = function(pimpl_, &result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
931 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
932 return result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
933 }
573
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
934 /**
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
935 * @brief Get some patient.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
936 *
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
937 * This method will return an object that contains information about some patient. The patients are indexed by a number between 0 (inclusive) and the result of GetPatientCount() (exclusive).
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
938 *
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
939 * @param index The index of the patient of interest.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
940 * @return The patient.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
941 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
942 inline ::OrthancClient::Patient OrthancConnection::GetPatient(LAAW_UINT32 index)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
943 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
944 void* result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
945 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, void**, LAAW_UINT32);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
946 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(8);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
947 char* error = function(pimpl_, &result_, index);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
948 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
949 return ::OrthancClient::Patient(result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
950 }
573
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
951 /**
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
952 * @brief Delete some patient.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
953 *
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
954 * Delete some patient from the remote instance of %Orthanc. Pay attention to the fact that the patients that have been previously returned by GetPatient() will be invalidated.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
955 *
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
956 * @param index The index of the patient of interest.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
957 * @return The patient.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
958 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
959 inline void OrthancConnection::DeletePatient(LAAW_UINT32 index)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
960 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
961 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, LAAW_UINT32);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
962 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(9);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
963 char* error = function(pimpl_, index);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
964 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
965 }
573
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
966 /**
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
967 * @brief Send a DICOM file.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
968 *
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
969 * This method will store a DICOM file in the remote instance of %Orthanc. Pay attention to the fact that the patients that have been previously returned by GetPatient() will be invalidated.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
970 *
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
971 * @param filename Path to the DICOM file
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
972 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
973 inline void OrthancConnection::StoreFile(const ::std::string& filename)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
974 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
975 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, const char*);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
976 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(10);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
977 char* error = function(pimpl_, filename.c_str());
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
978 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
979 }
573
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
980 /**
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
981 * @brief Send a DICOM file that is contained inside a memory buffer.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
982 *
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
983 * This method will store a DICOM file in the remote instance of %Orthanc. Pay attention to the fact that the patients that have been previously returned by GetPatient() will be invalidated.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
984 *
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
985 * @param dicom The memory buffer containing the DICOM file.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
986 * @param size The size of the DICOM file.
8fb9867d8089 documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 571
diff changeset
987 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
988 inline void OrthancConnection::Store(const void* dicom, LAAW_UINT64 size)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
989 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
990 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, const void*, LAAW_UINT64);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
991 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(11);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
992 char* error = function(pimpl_, dicom, size);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
993 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
994 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
995 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
996
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
997 namespace OrthancClient
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
998 {
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
999 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1000 * @brief Create a connection to some patient.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1001 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1002 * Create a connection to some patient.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1003 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1004 * @param connection The remote instance of %Orthanc.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1005 * @param id The %Orthanc identifier of the patient.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1006 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1007 inline Patient::Patient(::OrthancClient::OrthancConnection& connection, const ::std::string& id)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1008 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1009 isReference_ = false;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1010 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void**, void*, const char*);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1011 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(12);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1012 char* error = function(&pimpl_, connection.pimpl_, id.c_str());
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1013 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1014 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1015 /**
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1016 * @brief Destructs the object.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1017 *
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1018 * Destructs the object.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1019 *
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1020 **/
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1021 inline Patient::~Patient()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1022 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1023 if (isReference_) return;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1024 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1025 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(13);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1026 char* error = function(pimpl_);
657
5425bb6f1ea5 further cppcheck fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 629
diff changeset
1027 error = error; // Remove warning about unused variable
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1028 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1029 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1030 * @brief Reload the studies of this patient.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1031 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1032 * This method will reload the list of the studies of this patient. Pay attention to the fact that the studies that have been previously returned by GetStudy() will be invalidated.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1033 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1034 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1035 inline void Patient::Reload()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1036 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1037 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1038 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(14);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1039 char* error = function(pimpl_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1040 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1041 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1042 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1043 * @brief Return the number of studies for this patient.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1044 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1045 * Return the number of studies for this patient.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1046 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1047 * @return The number of studies.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1048 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1049 inline LAAW_UINT32 Patient::GetStudyCount()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1050 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1051 LAAW_UINT32 result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1052 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, LAAW_UINT32*);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1053 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(15);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1054 char* error = function(pimpl_, &result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1055 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1056 return result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1057 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1058 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1059 * @brief Get some study of this patient.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1060 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1061 * This method will return an object that contains information about some study. The studies are indexed by a number between 0 (inclusive) and the result of GetStudyCount() (exclusive).
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1062 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1063 * @param index The index of the study of interest.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1064 * @return The study.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1065 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1066 inline ::OrthancClient::Study Patient::GetStudy(LAAW_UINT32 index)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1067 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1068 void* result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1069 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, void**, LAAW_UINT32);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1070 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(16);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1071 char* error = function(pimpl_, &result_, index);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1072 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1073 return ::OrthancClient::Study(result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1074 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1075 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1076 * @brief Get the %Orthanc identifier of this patient.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1077 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1078 * Get the %Orthanc identifier of this patient.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1079 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1080 * @return The identifier.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1081 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1082 inline ::std::string Patient::GetId() const
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1083 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1084 const char* result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1085 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (const void*, const char**);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1086 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(17);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1087 char* error = function(pimpl_, &result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1088 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1089 return std::string(result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1090 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1091 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1092 * @brief Get the value of one of the main DICOM tags for this patient.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1093 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1094 * Get the value of one of the main DICOM tags for this patient.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1095 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1096 * @param tag The name of the tag of interest ("PatientName", "PatientID", "PatientSex" or "PatientBirthDate").
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1097 * @param defaultValue The default value to be returned if this tag does not exist.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1098 * @return The value of the tag.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1099 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1100 inline ::std::string Patient::GetMainDicomTag(const ::std::string& tag, const ::std::string& defaultValue) const
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1101 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1102 const char* result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1103 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (const void*, const char**, const char*, const char*);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1104 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(18);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1105 char* error = function(pimpl_, &result_, tag.c_str(), defaultValue.c_str());
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1106 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1107 return std::string(result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1108 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1109 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1110
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1111 namespace OrthancClient
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1112 {
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1113 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1114 * @brief Create a connection to some series.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1115 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1116 * Create a connection to some series.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1117 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1118 * @param connection The remote instance of %Orthanc.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1119 * @param id The %Orthanc identifier of the series.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1120 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1121 inline Series::Series(::OrthancClient::OrthancConnection& connection, const ::std::string& id)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1122 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1123 isReference_ = false;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1124 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void**, void*, const char*);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1125 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(19);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1126 char* error = function(&pimpl_, connection.pimpl_, id.c_str());
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1127 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1128 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1129 /**
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1130 * @brief Destructs the object.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1131 *
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1132 * Destructs the object.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1133 *
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1134 **/
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1135 inline Series::~Series()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1136 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1137 if (isReference_) return;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1138 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1139 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(20);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1140 char* error = function(pimpl_);
657
5425bb6f1ea5 further cppcheck fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 629
diff changeset
1141 error = error; // Remove warning about unused variable
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1142 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1143 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1144 * @brief Reload the instances of this series.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1145 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1146 * This method will reload the list of the instances of this series. Pay attention to the fact that the instances that have been previously returned by GetInstance() will be invalidated.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1147 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1148 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1149 inline void Series::Reload()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1150 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1151 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1152 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(21);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1153 char* error = function(pimpl_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1154 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1155 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1156 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1157 * @brief Return the number of instances for this series.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1158 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1159 * Return the number of instances for this series.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1160 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1161 * @return The number of instances.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1162 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1163 inline LAAW_UINT32 Series::GetInstanceCount()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1164 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1165 LAAW_UINT32 result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1166 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, LAAW_UINT32*);
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1167 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(22);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1168 char* error = function(pimpl_, &result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1169 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1170 return result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1171 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1172 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1173 * @brief Get some instance of this series.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1174 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1175 * This method will return an object that contains information about some instance. The instances are indexed by a number between 0 (inclusive) and the result of GetInstanceCount() (exclusive).
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1176 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1177 * @param index The index of the instance of interest.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1178 * @return The instance.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1179 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1180 inline ::OrthancClient::Instance Series::GetInstance(LAAW_UINT32 index)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1181 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1182 void* result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1183 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, void**, LAAW_UINT32);
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1184 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(23);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1185 char* error = function(pimpl_, &result_, index);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1186 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1187 return ::OrthancClient::Instance(result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1188 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1189 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1190 * @brief Get the %Orthanc identifier of this series.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1191 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1192 * Get the %Orthanc identifier of this series.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1193 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1194 * @return The identifier.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1195 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1196 inline ::std::string Series::GetId() const
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1197 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1198 const char* result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1199 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (const void*, const char**);
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1200 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(24);
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1201 char* error = function(pimpl_, &result_);
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1202 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1203 return std::string(result_);
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1204 }
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1205 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1206 * @brief Returns the URL to this series.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1207 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1208 * Returns the URL to this series.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1209 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1210 * @return The URL.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1211 **/
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1212 inline ::std::string Series::GetUrl() const
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1213 {
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1214 const char* result_;
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1215 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (const void*, const char**);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1216 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(25);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1217 char* error = function(pimpl_, &result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1218 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1219 return std::string(result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1220 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1221 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1222 * @brief Get the value of one of the main DICOM tags for this series.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1223 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1224 * Get the value of one of the main DICOM tags for this series.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1225 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1226 * @param tag The name of the tag of interest ("Modality", "Manufacturer", "SeriesDate", "SeriesDescription", "SeriesInstanceUID"...).
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1227 * @param defaultValue The default value to be returned if this tag does not exist.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1228 * @return The value of the tag.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1229 **/
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1230 inline ::std::string Series::GetMainDicomTag(const ::std::string& tag, const ::std::string& defaultValue) const
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1231 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1232 const char* result_;
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1233 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (const void*, const char**, const char*, const char*);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1234 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(26);
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1235 char* error = function(pimpl_, &result_, tag.c_str(), defaultValue.c_str());
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1236 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1237 return std::string(result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1238 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1239 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1240 * @brief Test whether this series encodes a 3D image that can be downloaded from %Orthanc.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1241 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1242 * Test whether this series encodes a 3D image that can be downloaded from %Orthanc.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1243 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1244 * @return "true" if and only if this is a 3D image.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1245 **/
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1246 inline bool Series::Is3DImage()
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1247 {
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1248 LAAW_INT32 result_;
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1249 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, LAAW_INT32*);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1250 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(27);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1251 char* error = function(pimpl_, &result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1252 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1253 return result_ != 0;
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1254 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1255 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1256 * @brief Get the width of the 3D image.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1257 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1258 * Get the width of the 3D image (i.e. along the X-axis). This call is only valid if this series corresponds to a 3D image.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1259 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1260 * @return The width.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1261 **/
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1262 inline LAAW_UINT32 Series::GetWidth()
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1263 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1264 LAAW_UINT32 result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1265 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, LAAW_UINT32*);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1266 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(28);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1267 char* error = function(pimpl_, &result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1268 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1269 return result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1270 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1271 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1272 * @brief Get the height of the 3D image.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1273 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1274 * Get the height of the 3D image (i.e. along the Y-axis). This call is only valid if this series corresponds to a 3D image.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1275 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1276 * @return The height.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1277 **/
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1278 inline LAAW_UINT32 Series::GetHeight()
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1279 {
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1280 LAAW_UINT32 result_;
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1281 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, LAAW_UINT32*);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1282 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(29);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1283 char* error = function(pimpl_, &result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1284 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1285 return result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1286 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1287 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1288 * @brief Get the physical size of a voxel along the X-axis.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1289 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1290 * Get the physical size of a voxel along the X-axis. This call is only valid if this series corresponds to a 3D image.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1291 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1292 * @return The voxel size.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1293 **/
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1294 inline float Series::GetVoxelSizeX()
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1295 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1296 float result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1297 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, float*);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1298 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(30);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1299 char* error = function(pimpl_, &result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1300 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1301 return result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1302 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1303 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1304 * @brief Get the physical size of a voxel along the Y-axis.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1305 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1306 * Get the physical size of a voxel along the Y-axis. This call is only valid if this series corresponds to a 3D image.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1307 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1308 * @return The voxel size.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1309 **/
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1310 inline float Series::GetVoxelSizeY()
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1311 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1312 float result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1313 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, float*);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1314 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(31);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1315 char* error = function(pimpl_, &result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1316 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1317 return result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1318 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1319 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1320 * @brief Get the physical size of a voxel along the Z-axis.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1321 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1322 * Get the physical size of a voxel along the Z-axis. This call is only valid if this series corresponds to a 3D image.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1323 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1324 * @return The voxel size.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1325 **/
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1326 inline float Series::GetVoxelSizeZ()
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1327 {
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1328 float result_;
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1329 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, float*);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1330 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(32);
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1331 char* error = function(pimpl_, &result_);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1332 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1333 return result_;
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1334 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1335 /**
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1336 * @brief Get the slice thickness.
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1337 *
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1338 * Get the slice thickness. This call is only valid if this series corresponds to a 3D image.
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1339 *
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1340 * @return The slice thickness.
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1341 **/
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1342 inline float Series::GetSliceThickness()
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1343 {
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1344 float result_;
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1345 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, float*);
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1346 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(33);
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1347 char* error = function(pimpl_, &result_);
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1348 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1349 return result_;
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1350 }
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1351 /**
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1352 * @brief Load the 3D image into a memory buffer.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1353 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1354 * Load the 3D image into a memory buffer. This call is only valid if this series corresponds to a 3D image. The "target" buffer must be wide enough to store all the voxels of the image.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1355 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1356 * @param target The target memory buffer.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1357 * @param format The memory layout of the voxels.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1358 * @param lineStride The number of bytes between two lines in the target memory buffer.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1359 * @param stackStride The number of bytes between two 2D slices in the target memory buffer.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1360 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1361 inline void Series::Load3DImage(void* target, ::Orthanc::PixelFormat format, LAAW_INT64 lineStride, LAAW_INT64 stackStride)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1362 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1363 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, void*, LAAW_INT32, LAAW_INT64, LAAW_INT64);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1364 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(34);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1365 char* error = function(pimpl_, target, format, lineStride, stackStride);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1366 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1367 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1368 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1369 * @brief Load the 3D image into a memory buffer.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1370 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1371 * Load the 3D image into a memory buffer. This call is only valid if this series corresponds to a 3D image. The "target" buffer must be wide enough to store all the voxels of the image. This method will also update a progress indicator to monitor the loading of the image.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1372 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1373 * @param target The target memory buffer.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1374 * @param format The memory layout of the voxels.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1375 * @param lineStride The number of bytes between two lines in the target memory buffer.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1376 * @param stackStride The number of bytes between two 2D slices in the target memory buffer.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1377 * @param progress A pointer to a floating-point number that is continuously updated by the download threads to reflect the percentage of completion (between 0 and 1). This value can be read from a separate thread.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1378 **/
548
ffedcc8f0938 progress
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 540
diff changeset
1379 inline void Series::Load3DImage(void* target, ::Orthanc::PixelFormat format, LAAW_INT64 lineStride, LAAW_INT64 stackStride, float progress[])
ffedcc8f0938 progress
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 540
diff changeset
1380 {
ffedcc8f0938 progress
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 540
diff changeset
1381 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, void*, LAAW_INT32, LAAW_INT64, LAAW_INT64, float*);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1382 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(35);
548
ffedcc8f0938 progress
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 540
diff changeset
1383 char* error = function(pimpl_, target, format, lineStride, stackStride, progress);
ffedcc8f0938 progress
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 540
diff changeset
1384 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
ffedcc8f0938 progress
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 540
diff changeset
1385 }
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1386 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1387
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1388 namespace OrthancClient
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1389 {
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1390 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1391 * @brief Create a connection to some study.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1392 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1393 * Create a connection to some study.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1394 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1395 * @param connection The remote instance of %Orthanc.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1396 * @param id The %Orthanc identifier of the study.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1397 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1398 inline Study::Study(::OrthancClient::OrthancConnection& connection, const ::std::string& id)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1399 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1400 isReference_ = false;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1401 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void**, void*, const char*);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1402 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(36);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1403 char* error = function(&pimpl_, connection.pimpl_, id.c_str());
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1404 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1405 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1406 /**
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1407 * @brief Destructs the object.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1408 *
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1409 * Destructs the object.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1410 *
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1411 **/
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1412 inline Study::~Study()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1413 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1414 if (isReference_) return;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1415 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1416 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(37);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1417 char* error = function(pimpl_);
657
5425bb6f1ea5 further cppcheck fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 629
diff changeset
1418 error = error; // Remove warning about unused variable
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1419 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1420 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1421 * @brief Reload the series of this study.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1422 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1423 * This method will reload the list of the series of this study. Pay attention to the fact that the series that have been previously returned by GetSeries() will be invalidated.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1424 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1425 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1426 inline void Study::Reload()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1427 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1428 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1429 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(38);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1430 char* error = function(pimpl_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1431 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1432 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1433 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1434 * @brief Return the number of series for this study.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1435 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1436 * Return the number of series for this study.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1437 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1438 * @return The number of series.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1439 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1440 inline LAAW_UINT32 Study::GetSeriesCount()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1441 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1442 LAAW_UINT32 result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1443 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, LAAW_UINT32*);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1444 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(39);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1445 char* error = function(pimpl_, &result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1446 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1447 return result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1448 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1449 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1450 * @brief Get some series of this study.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1451 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1452 * This method will return an object that contains information about some series. The series are indexed by a number between 0 (inclusive) and the result of GetSeriesCount() (exclusive).
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1453 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1454 * @param index The index of the series of interest.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1455 * @return The series.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1456 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1457 inline ::OrthancClient::Series Study::GetSeries(LAAW_UINT32 index)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1458 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1459 void* result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1460 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, void**, LAAW_UINT32);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1461 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(40);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1462 char* error = function(pimpl_, &result_, index);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1463 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1464 return ::OrthancClient::Series(result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1465 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1466 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1467 * @brief Get the %Orthanc identifier of this study.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1468 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1469 * Get the %Orthanc identifier of this study.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1470 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1471 * @return The identifier.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1472 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1473 inline ::std::string Study::GetId() const
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1474 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1475 const char* result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1476 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (const void*, const char**);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1477 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(41);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1478 char* error = function(pimpl_, &result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1479 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1480 return std::string(result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1481 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1482 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1483 * @brief Get the value of one of the main DICOM tags for this study.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1484 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1485 * Get the value of one of the main DICOM tags for this study.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1486 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1487 * @param tag The name of the tag of interest ("StudyDate", "StudyDescription", "StudyInstanceUID" or "StudyTime").
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1488 * @param defaultValue The default value to be returned if this tag does not exist.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1489 * @return The value of the tag.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1490 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1491 inline ::std::string Study::GetMainDicomTag(const ::std::string& tag, const ::std::string& defaultValue) const
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1492 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1493 const char* result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1494 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (const void*, const char**, const char*, const char*);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1495 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(42);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1496 char* error = function(pimpl_, &result_, tag.c_str(), defaultValue.c_str());
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1497 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1498 return std::string(result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1499 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1500 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1501
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1502 namespace OrthancClient
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1503 {
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1504 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1505 * @brief Create a connection to some image instance.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1506 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1507 * Create a connection to some image instance.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1508 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1509 * @param connection The remote instance of %Orthanc.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1510 * @param id The %Orthanc identifier of the image instance.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1511 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1512 inline Instance::Instance(::OrthancClient::OrthancConnection& connection, const ::std::string& id)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1513 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1514 isReference_ = false;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1515 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void**, void*, const char*);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1516 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(43);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1517 char* error = function(&pimpl_, connection.pimpl_, id.c_str());
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1518 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1519 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1520 /**
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1521 * @brief Destructs the object.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1522 *
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1523 * Destructs the object.
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1524 *
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1525 **/
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1526 inline Instance::~Instance()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1527 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1528 if (isReference_) return;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1529 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1530 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(44);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1531 char* error = function(pimpl_);
657
5425bb6f1ea5 further cppcheck fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 629
diff changeset
1532 error = error; // Remove warning about unused variable
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1533 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1534 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1535 * @brief Get the %Orthanc identifier of this identifier.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1536 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1537 * Get the %Orthanc identifier of this identifier.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1538 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1539 * @return The identifier.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1540 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1541 inline ::std::string Instance::GetId() const
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1542 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1543 const char* result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1544 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (const void*, const char**);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1545 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(45);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1546 char* error = function(pimpl_, &result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1547 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1548 return std::string(result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1549 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1550 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1551 * @brief Set the extraction mode for the 2D image corresponding to this instance.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1552 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1553 * Set the extraction mode for the 2D image corresponding to this instance.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1554 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1555 * @param mode The extraction mode.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1556 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1557 inline void Instance::SetImageExtractionMode(::Orthanc::ImageExtractionMode mode)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1558 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1559 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, LAAW_INT32);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1560 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(46);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1561 char* error = function(pimpl_, mode);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1562 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1563 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1564 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1565 * @brief Get the extraction mode for the 2D image corresponding to this instance.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1566 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1567 * Get the extraction mode for the 2D image corresponding to this instance.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1568 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1569 * @return The extraction mode.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1570 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1571 inline ::Orthanc::ImageExtractionMode Instance::GetImageExtractionMode() const
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1572 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1573 LAAW_INT32 result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1574 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (const void*, LAAW_INT32*);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1575 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(47);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1576 char* error = function(pimpl_, &result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1577 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1578 return static_cast< ::Orthanc::ImageExtractionMode >(result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1579 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1580 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1581 * @brief Get the string value of some DICOM tag of this instance.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1582 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1583 * Get the string value of some DICOM tag of this instance.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1584 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1585 * @param tag The name of the tag of interest.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1586 * @return The value of the tag.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1587 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1588 inline ::std::string Instance::GetTagAsString(const ::std::string& tag) const
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1589 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1590 const char* result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1591 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (const void*, const char**, const char*);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1592 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(48);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1593 char* error = function(pimpl_, &result_, tag.c_str());
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1594 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1595 return std::string(result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1596 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1597 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1598 * @brief Get the floating point value that is stored in some DICOM tag of this instance.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1599 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1600 * Get the floating point value that is stored in some DICOM tag of this instance.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1601 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1602 * @param tag The name of the tag of interest.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1603 * @return The value of the tag.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1604 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1605 inline float Instance::GetTagAsFloat(const ::std::string& tag) const
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1606 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1607 float result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1608 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (const void*, float*, const char*);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1609 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(49);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1610 char* error = function(pimpl_, &result_, tag.c_str());
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1611 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1612 return result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1613 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1614 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1615 * @brief Get the integer value that is stored in some DICOM tag of this instance.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1616 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1617 * Get the integer value that is stored in some DICOM tag of this instance.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1618 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1619 * @param tag The name of the tag of interest.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1620 * @return The value of the tag.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1621 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1622 inline LAAW_INT32 Instance::GetTagAsInt(const ::std::string& tag) const
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1623 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1624 LAAW_INT32 result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1625 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (const void*, LAAW_INT32*, const char*);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1626 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(50);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1627 char* error = function(pimpl_, &result_, tag.c_str());
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1628 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1629 return result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1630 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1631 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1632 * @brief Get the width of the 2D image.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1633 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1634 * Get the width of the 2D image that is encoded by this DICOM instance.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1635 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1636 * @return The width.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1637 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1638 inline LAAW_UINT32 Instance::GetWidth()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1639 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1640 LAAW_UINT32 result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1641 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, LAAW_UINT32*);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1642 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(51);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1643 char* error = function(pimpl_, &result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1644 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1645 return result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1646 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1647 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1648 * @brief Get the height of the 2D image.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1649 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1650 * Get the height of the 2D image that is encoded by this DICOM instance.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1651 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1652 * @return The height.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1653 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1654 inline LAAW_UINT32 Instance::GetHeight()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1655 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1656 LAAW_UINT32 result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1657 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, LAAW_UINT32*);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1658 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(52);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1659 char* error = function(pimpl_, &result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1660 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1661 return result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1662 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1663 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1664 * @brief Get the number of bytes between two lines of the image (pitch).
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1665 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1666 * Get the number of bytes between two lines of the image in the memory buffer returned by GetBuffer(). This value depends on the extraction mode for the image.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1667 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1668 * @return The pitch.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1669 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1670 inline LAAW_UINT32 Instance::GetPitch()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1671 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1672 LAAW_UINT32 result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1673 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, LAAW_UINT32*);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1674 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(53);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1675 char* error = function(pimpl_, &result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1676 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1677 return result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1678 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1679 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1680 * @brief Get the format of the pixels of the 2D image.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1681 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1682 * Return the memory layout that is used for the 2D image that is encoded by this DICOM instance. This value depends on the extraction mode for the image.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1683 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1684 * @return The pixel format.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1685 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1686 inline ::Orthanc::PixelFormat Instance::GetPixelFormat()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1687 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1688 LAAW_INT32 result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1689 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, LAAW_INT32*);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1690 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(54);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1691 char* error = function(pimpl_, &result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1692 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1693 return static_cast< ::Orthanc::PixelFormat >(result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1694 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1695 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1696 * @brief Access the memory buffer in which the raw pixels of the 2D image are stored.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1697 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1698 * Access the memory buffer in which the raw pixels of the 2D image are stored.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1699 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1700 * @return A pointer to the memory buffer.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1701 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1702 inline const void* Instance::GetBuffer()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1703 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1704 const void* result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1705 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, const void**);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1706 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(55);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1707 char* error = function(pimpl_, &result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1708 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1709 return reinterpret_cast< const void* >(result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1710 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1711 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1712 * @brief Access the memory buffer in which the raw pixels of some line of the 2D image are stored.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1713 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1714 * Access the memory buffer in which the raw pixels of some line of the 2D image are stored.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1715 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1716 * @param y The line of interest.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1717 * @return A pointer to the memory buffer.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1718 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1719 inline const void* Instance::GetBuffer(LAAW_UINT32 y)
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1720 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1721 const void* result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1722 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, const void**, LAAW_UINT32);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1723 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(56);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1724 char* error = function(pimpl_, &result_, y);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1725 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1726 return reinterpret_cast< const void* >(result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1727 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1728 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1729 * @brief Get the size of the DICOM file corresponding to this instance.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1730 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1731 * Get the size of the DICOM file corresponding to this instance.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1732 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1733 * @return The file size.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1734 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1735 inline LAAW_UINT64 Instance::GetDicomSize()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1736 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1737 LAAW_UINT64 result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1738 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, LAAW_UINT64*);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1739 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(57);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1740 char* error = function(pimpl_, &result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1741 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1742 return result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1743 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1744 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1745 * @brief Get a pointer to the content of the DICOM file corresponding to this instance.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1746 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1747 * Get a pointer to the content of the DICOM file corresponding to this instance.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1748 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1749 * @return The DICOM file.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1750 **/
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1751 inline const void* Instance::GetDicom()
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1752 {
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1753 const void* result_;
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1754 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, const void**);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1755 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(58);
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1756 char* error = function(pimpl_, &result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1757 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1758 return reinterpret_cast< const void* >(result_);
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1759 }
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1760 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1761 * @brief Discard the downloaded 2D image, so as to make room in memory.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1762 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1763 * Discard the downloaded 2D image, so as to make room in memory.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1764 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1765 **/
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1766 inline void Instance::DiscardImage()
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1767 {
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1768 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1769 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(59);
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1770 char* error = function(pimpl_);
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1771 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1772 }
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1773 /**
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1774 * @brief Discard the downloaded DICOM file, so as to make room in memory.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1775 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1776 * Discard the downloaded DICOM file, so as to make room in memory.
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1777 *
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1778 **/
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1779 inline void Instance::DiscardDicom()
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1780 {
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1781 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1782 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(60);
593
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1783 char* error = function(pimpl_);
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1784 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
9d2592c08919 documentation completed
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 591
diff changeset
1785 }
728
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1786 /**
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1787 * @brief Load a raw tag from the DICOM file.
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1788 *
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1789 * Load a raw tag from the DICOM file.
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1790 *
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1791 * @param path The path to the tag of interest (e.g. "0020-000d").
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1792 **/
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1793 inline void Instance::LoadTagContent(const ::std::string& path)
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1794 {
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1795 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (void*, const char*);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1796 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(61);
728
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1797 char* error = function(pimpl_, path.c_str());
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1798 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1799 }
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1800 /**
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1801 * @brief Return the value of the raw tag that was loaded by LoadContent.
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1802 *
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1803 * Return the value of the raw tag that was loaded by LoadContent.
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1804 *
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1805 * @return The tag value.
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1806 **/
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1807 inline ::std::string Instance::GetLoadedTagContent() const
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1808 {
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1809 const char* result_;
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1810 typedef char* (LAAW_ORTHANC_CLIENT_CALL_CONV* Function) (const void*, const char**);
986
de18e90d5507 fix GetVoxelSizeZ
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 865
diff changeset
1811 Function function = (Function) ::OrthancClient::Internals::Library::GetInstance().GetFunction(62);
728
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1812 char* error = function(pimpl_, &result_);
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1813 ::OrthancClient::Internals::Library::GetInstance().ThrowExceptionIfNeeded(error);
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1814 return std::string(result_);
d380222b4c2a Load a raw tag from the DICOM file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 660
diff changeset
1815 }
540
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1816 }
eaca3d38b2aa many fixes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1817