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