comparison Sources/Autogenerated/sdk_GlobalFunctions.impl.h @ 174:e9be3c9294d4 java-code-model

[IMPORTANT] replaced old auto-generated code with Java code model
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 27 Jun 2024 18:02:06 +0200
parents b49eeb36cd0d
children 194ba7d6e0f4
comparison
equal deleted inserted replaced
173:3c72d1f4c2a5 174:e9be3c9294d4
28 if (!PyArg_ParseTuple(args, "s", &arg0)) 28 if (!PyArg_ParseTuple(args, "s", &arg0))
29 { 29 {
30 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 30 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
31 return NULL; 31 return NULL;
32 } 32 }
33
33 const char* s = OrthancPluginAutodetectMimeType(OrthancPlugins::GetGlobalContext(), arg0); 34 const char* s = OrthancPluginAutodetectMimeType(OrthancPlugins::GetGlobalContext(), arg0);
34 35
35 if (s == NULL) 36 if (s == NULL)
36 { 37 {
37 Py_INCREF(Py_None); 38 Py_INCREF(Py_None);
54 if (!PyArg_ParseTuple(args, "s*lb", &arg0, &arg2, &arg3)) 55 if (!PyArg_ParseTuple(args, "s*lb", &arg0, &arg2, &arg3))
55 { 56 {
56 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); 57 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)");
57 return NULL; 58 return NULL;
58 } 59 }
60
59 OrthancPlugins::MemoryBuffer buffer; 61 OrthancPlugins::MemoryBuffer buffer;
60 OrthancPluginErrorCode code = OrthancPluginBufferCompression(OrthancPlugins::GetGlobalContext(), *buffer, arg0.buf, arg0.len, static_cast<OrthancPluginCompressionType>(arg2), arg3); 62 OrthancPluginErrorCode code = OrthancPluginBufferCompression(OrthancPlugins::GetGlobalContext(), *buffer, arg0.buf, arg0.len, static_cast<OrthancPluginCompressionType>(arg2), arg3);
61 PyBuffer_Release(&arg0); 63 PyBuffer_Release(&arg0);
62 if (code == OrthancPluginErrorCode_Success) 64 if (code == OrthancPluginErrorCode_Success)
63 { 65 {
73 static PyObject* sdk_OrthancPluginCheckVersion(PyObject* module, PyObject* args) 75 static PyObject* sdk_OrthancPluginCheckVersion(PyObject* module, PyObject* args)
74 { 76 {
75 PythonLock::LogCall("Calling Python global function: OrthancPluginCheckVersion()"); 77 PythonLock::LogCall("Calling Python global function: OrthancPluginCheckVersion()");
76 78
77 79
80
78 long value = OrthancPluginCheckVersion(OrthancPlugins::GetGlobalContext()); 81 long value = OrthancPluginCheckVersion(OrthancPlugins::GetGlobalContext());
79 82
80 return PyLong_FromLong(value); 83 return PyLong_FromLong(value);
81 } 84 }
82 85
83 static PyObject* sdk_OrthancPluginCheckVersionAdvanced(PyObject* module, PyObject* args) 86 static PyObject* sdk_OrthancPluginCheckVersionAdvanced(PyObject* module, PyObject* args)
84 { 87 {
85 PythonLock::LogCall("Calling Python global function: OrthancPluginCheckVersionAdvanced()"); 88 PythonLock::LogCall("Calling Python global function: OrthancPluginCheckVersionAdvanced()");
86 89
87 int arg0 = 0; 90 long int arg0 = 0;
88 int arg1 = 0; 91 long int arg1 = 0;
89 int arg2 = 0; 92 long int arg2 = 0;
90 93
91 if (!PyArg_ParseTuple(args, "iii", &arg0, &arg1, &arg2)) 94 if (!PyArg_ParseTuple(args, "lll", &arg0, &arg1, &arg2))
92 { 95 {
93 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); 96 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)");
94 return NULL; 97 return NULL;
95 } 98 }
99
96 long value = OrthancPluginCheckVersionAdvanced(OrthancPlugins::GetGlobalContext(), arg0, arg1, arg2); 100 long value = OrthancPluginCheckVersionAdvanced(OrthancPlugins::GetGlobalContext(), arg0, arg1, arg2);
97 101
98 return PyLong_FromLong(value); 102 return PyLong_FromLong(value);
99 } 103 }
100 104
112 if (!PyArg_ParseTuple(args, "lkkks*b", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5)) 116 if (!PyArg_ParseTuple(args, "lkkks*b", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5))
113 { 117 {
114 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (6 arguments expected)"); 118 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (6 arguments expected)");
115 return NULL; 119 return NULL;
116 } 120 }
121
117 OrthancPlugins::MemoryBuffer buffer; 122 OrthancPlugins::MemoryBuffer buffer;
118 OrthancPluginErrorCode code = OrthancPluginCompressJpegImage(OrthancPlugins::GetGlobalContext(), *buffer, static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2, arg3, arg4.buf, arg5); 123 OrthancPluginErrorCode code = OrthancPluginCompressJpegImage(OrthancPlugins::GetGlobalContext(), *buffer, static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2, arg3, arg4.buf, arg5);
119 PyBuffer_Release(&arg4); 124 PyBuffer_Release(&arg4);
120 if (code == OrthancPluginErrorCode_Success) 125 if (code == OrthancPluginErrorCode_Success)
121 { 126 {
141 if (!PyArg_ParseTuple(args, "lkkks*", &arg0, &arg1, &arg2, &arg3, &arg4)) 146 if (!PyArg_ParseTuple(args, "lkkks*", &arg0, &arg1, &arg2, &arg3, &arg4))
142 { 147 {
143 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (5 arguments expected)"); 148 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (5 arguments expected)");
144 return NULL; 149 return NULL;
145 } 150 }
151
146 OrthancPlugins::MemoryBuffer buffer; 152 OrthancPlugins::MemoryBuffer buffer;
147 OrthancPluginErrorCode code = OrthancPluginCompressPngImage(OrthancPlugins::GetGlobalContext(), *buffer, static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2, arg3, arg4.buf); 153 OrthancPluginErrorCode code = OrthancPluginCompressPngImage(OrthancPlugins::GetGlobalContext(), *buffer, static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2, arg3, arg4.buf);
148 PyBuffer_Release(&arg4); 154 PyBuffer_Release(&arg4);
149 if (code == OrthancPluginErrorCode_Success) 155 if (code == OrthancPluginErrorCode_Success)
150 { 156 {
166 if (!PyArg_ParseTuple(args, "s*", &arg0)) 172 if (!PyArg_ParseTuple(args, "s*", &arg0))
167 { 173 {
168 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 174 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
169 return NULL; 175 return NULL;
170 } 176 }
177
171 OrthancPlugins::OrthancString s; 178 OrthancPlugins::OrthancString s;
172 s.Assign(OrthancPluginComputeMd5(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len)); 179 s.Assign(OrthancPluginComputeMd5(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len));
173 PyBuffer_Release(&arg0); 180 PyBuffer_Release(&arg0);
174 if (s.GetContent() == NULL) 181 if (s.GetContent() == NULL)
175 { 182 {
191 if (!PyArg_ParseTuple(args, "s*", &arg0)) 198 if (!PyArg_ParseTuple(args, "s*", &arg0))
192 { 199 {
193 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 200 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
194 return NULL; 201 return NULL;
195 } 202 }
203
196 OrthancPlugins::OrthancString s; 204 OrthancPlugins::OrthancString s;
197 s.Assign(OrthancPluginComputeSha1(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len)); 205 s.Assign(OrthancPluginComputeSha1(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len));
198 PyBuffer_Release(&arg0); 206 PyBuffer_Release(&arg0);
199 if (s.GetContent() == NULL) 207 if (s.GetContent() == NULL)
200 { 208 {
205 { 213 {
206 return PyUnicode_FromString(s.GetContent()); 214 return PyUnicode_FromString(s.GetContent());
207 } 215 }
208 } 216 }
209 217
218 static PyObject* sdk_OrthancPluginCreateDicom(PyObject* module, PyObject* args)
219 {
220 PythonLock::LogCall("Calling Python global function: OrthancPluginCreateDicom()");
221
222 const char* arg0 = NULL;
223 PyObject* arg1 = NULL;
224 long int arg2 = 0;
225
226 if (!PyArg_ParseTuple(args, "sOl", &arg0, &arg1, &arg2))
227 {
228 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)");
229 return NULL;
230 }
231
232 if (arg1 != Py_None && Py_TYPE(arg1) != GetOrthancPluginImageType())
233 {
234 PyErr_SetString(PyExc_TypeError, "Invalid orthanc.OrthancPluginImage object");
235 return NULL;
236 }
237
238 OrthancPlugins::MemoryBuffer buffer;
239 OrthancPluginErrorCode code = OrthancPluginCreateDicom(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1 == Py_None ? NULL : reinterpret_cast<sdk_OrthancPluginImage_Object*>(arg1)->object_, static_cast<OrthancPluginCreateDicomFlags>(arg2));
240
241 if (code == OrthancPluginErrorCode_Success)
242 {
243 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize());
244 }
245 else
246 {
247 PythonLock::RaiseException(code);
248 return NULL;
249 }
250 }
251
252 static PyObject* sdk_OrthancPluginCreateDicom2(PyObject* module, PyObject* args)
253 {
254 PythonLock::LogCall("Calling Python global function: OrthancPluginCreateDicom2()");
255
256 const char* arg0 = NULL;
257 PyObject* arg1 = NULL;
258 long int arg2 = 0;
259 const char* arg3 = NULL;
260
261 if (!PyArg_ParseTuple(args, "sOls", &arg0, &arg1, &arg2, &arg3))
262 {
263 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)");
264 return NULL;
265 }
266
267 if (arg1 != Py_None && Py_TYPE(arg1) != GetOrthancPluginImageType())
268 {
269 PyErr_SetString(PyExc_TypeError, "Invalid orthanc.OrthancPluginImage object");
270 return NULL;
271 }
272
273 OrthancPlugins::MemoryBuffer buffer;
274 OrthancPluginErrorCode code = OrthancPluginCreateDicom2(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1 == Py_None ? NULL : reinterpret_cast<sdk_OrthancPluginImage_Object*>(arg1)->object_, static_cast<OrthancPluginCreateDicomFlags>(arg2), arg3);
275
276 if (code == OrthancPluginErrorCode_Success)
277 {
278 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize());
279 }
280 else
281 {
282 PythonLock::RaiseException(code);
283 return NULL;
284 }
285 }
286
210 static PyObject* sdk_OrthancPluginCreateDicomInstance(PyObject* module, PyObject* args) 287 static PyObject* sdk_OrthancPluginCreateDicomInstance(PyObject* module, PyObject* args)
211 { 288 {
212 PythonLock::LogCall("Calling Python global function: OrthancPluginCreateDicomInstance()"); 289 PythonLock::LogCall("Calling Python global function: OrthancPluginCreateDicomInstance()");
213 290
214 Py_buffer arg0; 291 Py_buffer arg0;
216 if (!PyArg_ParseTuple(args, "s*", &arg0)) 293 if (!PyArg_ParseTuple(args, "s*", &arg0))
217 { 294 {
218 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 295 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
219 return NULL; 296 return NULL;
220 } 297 }
298
221 // This is the case of a constructor 299 // This is the case of a constructor
222 OrthancPluginDicomInstance* obj = OrthancPluginCreateDicomInstance(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len); 300 OrthancPluginDicomInstance* obj = OrthancPluginCreateDicomInstance(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len);
223 PyBuffer_Release(&arg0); 301 PyBuffer_Release(&arg0);
224 if (obj == NULL) 302 if (obj == NULL)
225 { 303 {
244 if (!PyArg_ParseTuple(args, "s*", &arg0)) 322 if (!PyArg_ParseTuple(args, "s*", &arg0))
245 { 323 {
246 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 324 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
247 return NULL; 325 return NULL;
248 } 326 }
327
249 // This is the case of a constructor 328 // This is the case of a constructor
250 OrthancPluginFindMatcher* obj = OrthancPluginCreateFindMatcher(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len); 329 OrthancPluginFindMatcher* obj = OrthancPluginCreateFindMatcher(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len);
251 PyBuffer_Release(&arg0); 330 PyBuffer_Release(&arg0);
252 if (obj == NULL) 331 if (obj == NULL)
253 { 332 {
274 if (!PyArg_ParseTuple(args, "lkk", &arg0, &arg1, &arg2)) 353 if (!PyArg_ParseTuple(args, "lkk", &arg0, &arg1, &arg2))
275 { 354 {
276 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); 355 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)");
277 return NULL; 356 return NULL;
278 } 357 }
358
279 // This is the case of a constructor 359 // This is the case of a constructor
280 OrthancPluginImage* obj = OrthancPluginCreateImage(OrthancPlugins::GetGlobalContext(), static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2); 360 OrthancPluginImage* obj = OrthancPluginCreateImage(OrthancPlugins::GetGlobalContext(), static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2);
281 361
282 if (obj == NULL) 362 if (obj == NULL)
283 { 363 {
302 if (!PyArg_ParseTuple(args, "k", &arg0)) 382 if (!PyArg_ParseTuple(args, "k", &arg0))
303 { 383 {
304 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 384 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
305 return NULL; 385 return NULL;
306 } 386 }
387
307 OrthancPlugins::MemoryBuffer buffer; 388 OrthancPlugins::MemoryBuffer buffer;
308 OrthancPluginErrorCode code = OrthancPluginCreateMemoryBuffer(OrthancPlugins::GetGlobalContext(), *buffer, arg0); 389 OrthancPluginErrorCode code = OrthancPluginCreateMemoryBuffer(OrthancPlugins::GetGlobalContext(), *buffer, arg0);
309 390
310 if (code == OrthancPluginErrorCode_Success) 391 if (code == OrthancPluginErrorCode_Success)
311 { 392 {
328 if (!PyArg_ParseTuple(args, "s*k", &arg0, &arg2)) 409 if (!PyArg_ParseTuple(args, "s*k", &arg0, &arg2))
329 { 410 {
330 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); 411 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
331 return NULL; 412 return NULL;
332 } 413 }
414
333 // This is the case of a constructor 415 // This is the case of a constructor
334 OrthancPluginImage* obj = OrthancPluginDecodeDicomImage(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len, arg2); 416 OrthancPluginImage* obj = OrthancPluginDecodeDicomImage(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len, arg2);
335 PyBuffer_Release(&arg0); 417 PyBuffer_Release(&arg0);
336 if (obj == NULL) 418 if (obj == NULL)
337 { 419 {
359 if (!PyArg_ParseTuple(args, "s*llk", &arg0, &arg2, &arg3, &arg4)) 441 if (!PyArg_ParseTuple(args, "s*llk", &arg0, &arg2, &arg3, &arg4))
360 { 442 {
361 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)"); 443 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)");
362 return NULL; 444 return NULL;
363 } 445 }
446
364 OrthancPlugins::OrthancString s; 447 OrthancPlugins::OrthancString s;
365 s.Assign(OrthancPluginDicomBufferToJson(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len, static_cast<OrthancPluginDicomToJsonFormat>(arg2), static_cast<OrthancPluginDicomToJsonFlags>(arg3), arg4)); 448 s.Assign(OrthancPluginDicomBufferToJson(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len, static_cast<OrthancPluginDicomToJsonFormat>(arg2), static_cast<OrthancPluginDicomToJsonFlags>(arg3), arg4));
366 PyBuffer_Release(&arg0); 449 PyBuffer_Release(&arg0);
367 if (s.GetContent() == NULL) 450 if (s.GetContent() == NULL)
368 { 451 {
387 if (!PyArg_ParseTuple(args, "sllk", &arg0, &arg1, &arg2, &arg3)) 470 if (!PyArg_ParseTuple(args, "sllk", &arg0, &arg1, &arg2, &arg3))
388 { 471 {
389 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)"); 472 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)");
390 return NULL; 473 return NULL;
391 } 474 }
475
392 OrthancPlugins::OrthancString s; 476 OrthancPlugins::OrthancString s;
393 s.Assign(OrthancPluginDicomInstanceToJson(OrthancPlugins::GetGlobalContext(), arg0, static_cast<OrthancPluginDicomToJsonFormat>(arg1), static_cast<OrthancPluginDicomToJsonFlags>(arg2), arg3)); 477 s.Assign(OrthancPluginDicomInstanceToJson(OrthancPlugins::GetGlobalContext(), arg0, static_cast<OrthancPluginDicomToJsonFormat>(arg1), static_cast<OrthancPluginDicomToJsonFlags>(arg2), arg3));
394 478
395 if (s.GetContent() == NULL) 479 if (s.GetContent() == NULL)
396 { 480 {
412 if (!PyArg_ParseTuple(args, "s", &arg0)) 496 if (!PyArg_ParseTuple(args, "s", &arg0))
413 { 497 {
414 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 498 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
415 return NULL; 499 return NULL;
416 } 500 }
501
417 OrthancPluginExtendOrthancExplorer(OrthancPlugins::GetGlobalContext(), arg0); 502 OrthancPluginExtendOrthancExplorer(OrthancPlugins::GetGlobalContext(), arg0);
418 503
419 504
420 Py_INCREF(Py_None); 505 Py_INCREF(Py_None);
421 return Py_None; 506 return Py_None;
424 static PyObject* sdk_OrthancPluginGenerateRestApiAuthorizationToken(PyObject* module, PyObject* args) 509 static PyObject* sdk_OrthancPluginGenerateRestApiAuthorizationToken(PyObject* module, PyObject* args)
425 { 510 {
426 PythonLock::LogCall("Calling Python global function: OrthancPluginGenerateRestApiAuthorizationToken()"); 511 PythonLock::LogCall("Calling Python global function: OrthancPluginGenerateRestApiAuthorizationToken()");
427 512
428 513
514
429 OrthancPlugins::OrthancString s; 515 OrthancPlugins::OrthancString s;
430 s.Assign(OrthancPluginGenerateRestApiAuthorizationToken(OrthancPlugins::GetGlobalContext())); 516 s.Assign(OrthancPluginGenerateRestApiAuthorizationToken(OrthancPlugins::GetGlobalContext()));
431 517
432 if (s.GetContent() == NULL) 518 if (s.GetContent() == NULL)
433 { 519 {
443 static PyObject* sdk_OrthancPluginGenerateUuid(PyObject* module, PyObject* args) 529 static PyObject* sdk_OrthancPluginGenerateUuid(PyObject* module, PyObject* args)
444 { 530 {
445 PythonLock::LogCall("Calling Python global function: OrthancPluginGenerateUuid()"); 531 PythonLock::LogCall("Calling Python global function: OrthancPluginGenerateUuid()");
446 532
447 533
534
448 OrthancPlugins::OrthancString s; 535 OrthancPlugins::OrthancString s;
449 s.Assign(OrthancPluginGenerateUuid(OrthancPlugins::GetGlobalContext())); 536 s.Assign(OrthancPluginGenerateUuid(OrthancPlugins::GetGlobalContext()));
450 537
451 if (s.GetContent() == NULL) 538 if (s.GetContent() == NULL)
452 { 539 {
468 if (!PyArg_ParseTuple(args, "k", &arg0)) 555 if (!PyArg_ParseTuple(args, "k", &arg0))
469 { 556 {
470 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 557 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
471 return NULL; 558 return NULL;
472 } 559 }
560
473 OrthancPlugins::OrthancString s; 561 OrthancPlugins::OrthancString s;
474 s.Assign(OrthancPluginGetCommandLineArgument(OrthancPlugins::GetGlobalContext(), arg0)); 562 s.Assign(OrthancPluginGetCommandLineArgument(OrthancPlugins::GetGlobalContext(), arg0));
475 563
476 if (s.GetContent() == NULL) 564 if (s.GetContent() == NULL)
477 { 565 {
487 static PyObject* sdk_OrthancPluginGetCommandLineArgumentsCount(PyObject* module, PyObject* args) 575 static PyObject* sdk_OrthancPluginGetCommandLineArgumentsCount(PyObject* module, PyObject* args)
488 { 576 {
489 PythonLock::LogCall("Calling Python global function: OrthancPluginGetCommandLineArgumentsCount()"); 577 PythonLock::LogCall("Calling Python global function: OrthancPluginGetCommandLineArgumentsCount()");
490 578
491 579
580
492 long value = OrthancPluginGetCommandLineArgumentsCount(OrthancPlugins::GetGlobalContext()); 581 long value = OrthancPluginGetCommandLineArgumentsCount(OrthancPlugins::GetGlobalContext());
493 582
494 return PyLong_FromLong(value); 583 return PyLong_FromLong(value);
495 } 584 }
496 585
497 static PyObject* sdk_OrthancPluginGetConfiguration(PyObject* module, PyObject* args) 586 static PyObject* sdk_OrthancPluginGetConfiguration(PyObject* module, PyObject* args)
498 { 587 {
499 PythonLock::LogCall("Calling Python global function: OrthancPluginGetConfiguration()"); 588 PythonLock::LogCall("Calling Python global function: OrthancPluginGetConfiguration()");
589
500 590
501 591
502 OrthancPlugins::OrthancString s; 592 OrthancPlugins::OrthancString s;
503 s.Assign(OrthancPluginGetConfiguration(OrthancPlugins::GetGlobalContext())); 593 s.Assign(OrthancPluginGetConfiguration(OrthancPlugins::GetGlobalContext()));
504 594
516 static PyObject* sdk_OrthancPluginGetConfigurationPath(PyObject* module, PyObject* args) 606 static PyObject* sdk_OrthancPluginGetConfigurationPath(PyObject* module, PyObject* args)
517 { 607 {
518 PythonLock::LogCall("Calling Python global function: OrthancPluginGetConfigurationPath()"); 608 PythonLock::LogCall("Calling Python global function: OrthancPluginGetConfigurationPath()");
519 609
520 610
611
521 OrthancPlugins::OrthancString s; 612 OrthancPlugins::OrthancString s;
522 s.Assign(OrthancPluginGetConfigurationPath(OrthancPlugins::GetGlobalContext())); 613 s.Assign(OrthancPluginGetConfigurationPath(OrthancPlugins::GetGlobalContext()));
523 614
524 if (s.GetContent() == NULL) 615 if (s.GetContent() == NULL)
525 { 616 {
541 if (!PyArg_ParseTuple(args, "s", &arg0)) 632 if (!PyArg_ParseTuple(args, "s", &arg0))
542 { 633 {
543 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 634 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
544 return NULL; 635 return NULL;
545 } 636 }
637
546 OrthancPlugins::MemoryBuffer buffer; 638 OrthancPlugins::MemoryBuffer buffer;
547 OrthancPluginErrorCode code = OrthancPluginGetDicomForInstance(OrthancPlugins::GetGlobalContext(), *buffer, arg0); 639 OrthancPluginErrorCode code = OrthancPluginGetDicomForInstance(OrthancPlugins::GetGlobalContext(), *buffer, arg0);
548 640
549 if (code == OrthancPluginErrorCode_Success) 641 if (code == OrthancPluginErrorCode_Success)
550 { 642 {
566 if (!PyArg_ParseTuple(args, "l", &arg0)) 658 if (!PyArg_ParseTuple(args, "l", &arg0))
567 { 659 {
568 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 660 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
569 return NULL; 661 return NULL;
570 } 662 }
663
571 const char* s = OrthancPluginGetErrorDescription(OrthancPlugins::GetGlobalContext(), static_cast<OrthancPluginErrorCode>(arg0)); 664 const char* s = OrthancPluginGetErrorDescription(OrthancPlugins::GetGlobalContext(), static_cast<OrthancPluginErrorCode>(arg0));
572 665
573 if (s == NULL) 666 if (s == NULL)
574 { 667 {
575 Py_INCREF(Py_None); 668 Py_INCREF(Py_None);
584 static PyObject* sdk_OrthancPluginGetExpectedDatabaseVersion(PyObject* module, PyObject* args) 677 static PyObject* sdk_OrthancPluginGetExpectedDatabaseVersion(PyObject* module, PyObject* args)
585 { 678 {
586 PythonLock::LogCall("Calling Python global function: OrthancPluginGetExpectedDatabaseVersion()"); 679 PythonLock::LogCall("Calling Python global function: OrthancPluginGetExpectedDatabaseVersion()");
587 680
588 681
682
589 long value = OrthancPluginGetExpectedDatabaseVersion(OrthancPlugins::GetGlobalContext()); 683 long value = OrthancPluginGetExpectedDatabaseVersion(OrthancPlugins::GetGlobalContext());
590 684
591 return PyLong_FromLong(value); 685 return PyLong_FromLong(value);
592 } 686 }
593 687
600 if (!PyArg_ParseTuple(args, "k", &arg0)) 694 if (!PyArg_ParseTuple(args, "k", &arg0))
601 { 695 {
602 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 696 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
603 return NULL; 697 return NULL;
604 } 698 }
699
605 const char* s = OrthancPluginGetFontName(OrthancPlugins::GetGlobalContext(), arg0); 700 const char* s = OrthancPluginGetFontName(OrthancPlugins::GetGlobalContext(), arg0);
606 701
607 if (s == NULL) 702 if (s == NULL)
608 { 703 {
609 Py_INCREF(Py_None); 704 Py_INCREF(Py_None);
624 if (!PyArg_ParseTuple(args, "k", &arg0)) 719 if (!PyArg_ParseTuple(args, "k", &arg0))
625 { 720 {
626 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 721 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
627 return NULL; 722 return NULL;
628 } 723 }
724
629 long value = OrthancPluginGetFontSize(OrthancPlugins::GetGlobalContext(), arg0); 725 long value = OrthancPluginGetFontSize(OrthancPlugins::GetGlobalContext(), arg0);
630 726
631 return PyLong_FromLong(value); 727 return PyLong_FromLong(value);
632 } 728 }
633 729
634 static PyObject* sdk_OrthancPluginGetFontsCount(PyObject* module, PyObject* args) 730 static PyObject* sdk_OrthancPluginGetFontsCount(PyObject* module, PyObject* args)
635 { 731 {
636 PythonLock::LogCall("Calling Python global function: OrthancPluginGetFontsCount()"); 732 PythonLock::LogCall("Calling Python global function: OrthancPluginGetFontsCount()");
733
637 734
638 735
639 long value = OrthancPluginGetFontsCount(OrthancPlugins::GetGlobalContext()); 736 long value = OrthancPluginGetFontsCount(OrthancPlugins::GetGlobalContext());
640 737
641 return PyLong_FromLong(value); 738 return PyLong_FromLong(value);
651 if (!PyArg_ParseTuple(args, "ls", &arg0, &arg1)) 748 if (!PyArg_ParseTuple(args, "ls", &arg0, &arg1))
652 { 749 {
653 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); 750 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
654 return NULL; 751 return NULL;
655 } 752 }
753
656 OrthancPlugins::OrthancString s; 754 OrthancPlugins::OrthancString s;
657 s.Assign(OrthancPluginGetGlobalProperty(OrthancPlugins::GetGlobalContext(), arg0, arg1)); 755 s.Assign(OrthancPluginGetGlobalProperty(OrthancPlugins::GetGlobalContext(), arg0, arg1));
658 756
659 if (s.GetContent() == NULL) 757 if (s.GetContent() == NULL)
660 { 758 {
670 static PyObject* sdk_OrthancPluginGetOrthancDirectory(PyObject* module, PyObject* args) 768 static PyObject* sdk_OrthancPluginGetOrthancDirectory(PyObject* module, PyObject* args)
671 { 769 {
672 PythonLock::LogCall("Calling Python global function: OrthancPluginGetOrthancDirectory()"); 770 PythonLock::LogCall("Calling Python global function: OrthancPluginGetOrthancDirectory()");
673 771
674 772
773
675 OrthancPlugins::OrthancString s; 774 OrthancPlugins::OrthancString s;
676 s.Assign(OrthancPluginGetOrthancDirectory(OrthancPlugins::GetGlobalContext())); 775 s.Assign(OrthancPluginGetOrthancDirectory(OrthancPlugins::GetGlobalContext()));
677 776
678 if (s.GetContent() == NULL) 777 if (s.GetContent() == NULL)
679 { 778 {
689 static PyObject* sdk_OrthancPluginGetOrthancPath(PyObject* module, PyObject* args) 788 static PyObject* sdk_OrthancPluginGetOrthancPath(PyObject* module, PyObject* args)
690 { 789 {
691 PythonLock::LogCall("Calling Python global function: OrthancPluginGetOrthancPath()"); 790 PythonLock::LogCall("Calling Python global function: OrthancPluginGetOrthancPath()");
692 791
693 792
793
694 OrthancPlugins::OrthancString s; 794 OrthancPlugins::OrthancString s;
695 s.Assign(OrthancPluginGetOrthancPath(OrthancPlugins::GetGlobalContext())); 795 s.Assign(OrthancPluginGetOrthancPath(OrthancPlugins::GetGlobalContext()));
696 796
697 if (s.GetContent() == NULL) 797 if (s.GetContent() == NULL)
698 { 798 {
706 } 806 }
707 807
708 static PyObject* sdk_OrthancPluginGetPeers(PyObject* module, PyObject* args) 808 static PyObject* sdk_OrthancPluginGetPeers(PyObject* module, PyObject* args)
709 { 809 {
710 PythonLock::LogCall("Calling Python global function: OrthancPluginGetPeers()"); 810 PythonLock::LogCall("Calling Python global function: OrthancPluginGetPeers()");
811
711 812
712 813
713 // This is the case of a constructor 814 // This is the case of a constructor
714 OrthancPluginPeers* obj = OrthancPluginGetPeers(OrthancPlugins::GetGlobalContext()); 815 OrthancPluginPeers* obj = OrthancPluginGetPeers(OrthancPlugins::GetGlobalContext());
715 816
738 if (!PyArg_ParseTuple(args, "HHs", &arg0, &arg1, &arg2)) 839 if (!PyArg_ParseTuple(args, "HHs", &arg0, &arg1, &arg2))
739 { 840 {
740 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); 841 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)");
741 return NULL; 842 return NULL;
742 } 843 }
844
743 OrthancPlugins::OrthancString s; 845 OrthancPlugins::OrthancString s;
744 s.Assign(OrthancPluginGetTagName(OrthancPlugins::GetGlobalContext(), arg0, arg1, arg2)); 846 s.Assign(OrthancPluginGetTagName(OrthancPlugins::GetGlobalContext(), arg0, arg1, arg2));
745 847
746 if (s.GetContent() == NULL) 848 if (s.GetContent() == NULL)
747 { 849 {
765 if (!PyArg_ParseTuple(args, "sss", &arg0, &arg1, &arg2)) 867 if (!PyArg_ParseTuple(args, "sss", &arg0, &arg1, &arg2))
766 { 868 {
767 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); 869 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)");
768 return NULL; 870 return NULL;
769 } 871 }
872
770 OrthancPluginErrorCode code = OrthancPluginHttpDelete(OrthancPlugins::GetGlobalContext(), arg0, arg1, arg2); 873 OrthancPluginErrorCode code = OrthancPluginHttpDelete(OrthancPlugins::GetGlobalContext(), arg0, arg1, arg2);
771 874
772 875
773 if (code == OrthancPluginErrorCode_Success) 876 if (code == OrthancPluginErrorCode_Success)
774 { 877 {
793 if (!PyArg_ParseTuple(args, "sss", &arg0, &arg1, &arg2)) 896 if (!PyArg_ParseTuple(args, "sss", &arg0, &arg1, &arg2))
794 { 897 {
795 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); 898 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)");
796 return NULL; 899 return NULL;
797 } 900 }
901
798 OrthancPlugins::MemoryBuffer buffer; 902 OrthancPlugins::MemoryBuffer buffer;
799 OrthancPluginErrorCode code = OrthancPluginHttpGet(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1, arg2); 903 OrthancPluginErrorCode code = OrthancPluginHttpGet(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1, arg2);
800 904
801 if (code == OrthancPluginErrorCode_Success) 905 if (code == OrthancPluginErrorCode_Success)
802 { 906 {
821 if (!PyArg_ParseTuple(args, "ss*ss", &arg0, &arg1, &arg3, &arg4)) 925 if (!PyArg_ParseTuple(args, "ss*ss", &arg0, &arg1, &arg3, &arg4))
822 { 926 {
823 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)"); 927 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)");
824 return NULL; 928 return NULL;
825 } 929 }
930
826 OrthancPlugins::MemoryBuffer buffer; 931 OrthancPlugins::MemoryBuffer buffer;
827 OrthancPluginErrorCode code = OrthancPluginHttpPost(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1.buf, arg1.len, arg3, arg4); 932 OrthancPluginErrorCode code = OrthancPluginHttpPost(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1.buf, arg1.len, arg3, arg4);
828 PyBuffer_Release(&arg1); 933 PyBuffer_Release(&arg1);
829 if (code == OrthancPluginErrorCode_Success) 934 if (code == OrthancPluginErrorCode_Success)
830 { 935 {
849 if (!PyArg_ParseTuple(args, "ss*ss", &arg0, &arg1, &arg3, &arg4)) 954 if (!PyArg_ParseTuple(args, "ss*ss", &arg0, &arg1, &arg3, &arg4))
850 { 955 {
851 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)"); 956 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)");
852 return NULL; 957 return NULL;
853 } 958 }
959
854 OrthancPlugins::MemoryBuffer buffer; 960 OrthancPlugins::MemoryBuffer buffer;
855 OrthancPluginErrorCode code = OrthancPluginHttpPut(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1.buf, arg1.len, arg3, arg4); 961 OrthancPluginErrorCode code = OrthancPluginHttpPut(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1.buf, arg1.len, arg3, arg4);
856 PyBuffer_Release(&arg1); 962 PyBuffer_Release(&arg1);
857 if (code == OrthancPluginErrorCode_Success) 963 if (code == OrthancPluginErrorCode_Success)
858 { 964 {
874 if (!PyArg_ParseTuple(args, "s", &arg0)) 980 if (!PyArg_ParseTuple(args, "s", &arg0))
875 { 981 {
876 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 982 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
877 return NULL; 983 return NULL;
878 } 984 }
985
879 OrthancPluginLogError(OrthancPlugins::GetGlobalContext(), arg0); 986 OrthancPluginLogError(OrthancPlugins::GetGlobalContext(), arg0);
880 987
881 988
882 Py_INCREF(Py_None); 989 Py_INCREF(Py_None);
883 return Py_None; 990 return Py_None;
892 if (!PyArg_ParseTuple(args, "s", &arg0)) 999 if (!PyArg_ParseTuple(args, "s", &arg0))
893 { 1000 {
894 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 1001 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
895 return NULL; 1002 return NULL;
896 } 1003 }
1004
897 OrthancPluginLogInfo(OrthancPlugins::GetGlobalContext(), arg0); 1005 OrthancPluginLogInfo(OrthancPlugins::GetGlobalContext(), arg0);
898 1006
899 1007
900 Py_INCREF(Py_None); 1008 Py_INCREF(Py_None);
901 return Py_None; 1009 return Py_None;
910 if (!PyArg_ParseTuple(args, "s", &arg0)) 1018 if (!PyArg_ParseTuple(args, "s", &arg0))
911 { 1019 {
912 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 1020 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
913 return NULL; 1021 return NULL;
914 } 1022 }
1023
915 OrthancPluginLogWarning(OrthancPlugins::GetGlobalContext(), arg0); 1024 OrthancPluginLogWarning(OrthancPlugins::GetGlobalContext(), arg0);
916 1025
917 1026
918 Py_INCREF(Py_None); 1027 Py_INCREF(Py_None);
919 return Py_None; 1028 return Py_None;
928 if (!PyArg_ParseTuple(args, "s", &arg0)) 1037 if (!PyArg_ParseTuple(args, "s", &arg0))
929 { 1038 {
930 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 1039 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
931 return NULL; 1040 return NULL;
932 } 1041 }
1042
933 OrthancPlugins::OrthancString s; 1043 OrthancPlugins::OrthancString s;
934 s.Assign(OrthancPluginLookupInstance(OrthancPlugins::GetGlobalContext(), arg0)); 1044 s.Assign(OrthancPluginLookupInstance(OrthancPlugins::GetGlobalContext(), arg0));
935 1045
936 if (s.GetContent() == NULL) 1046 if (s.GetContent() == NULL)
937 { 1047 {
953 if (!PyArg_ParseTuple(args, "s", &arg0)) 1063 if (!PyArg_ParseTuple(args, "s", &arg0))
954 { 1064 {
955 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 1065 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
956 return NULL; 1066 return NULL;
957 } 1067 }
1068
958 OrthancPlugins::OrthancString s; 1069 OrthancPlugins::OrthancString s;
959 s.Assign(OrthancPluginLookupPatient(OrthancPlugins::GetGlobalContext(), arg0)); 1070 s.Assign(OrthancPluginLookupPatient(OrthancPlugins::GetGlobalContext(), arg0));
960 1071
961 if (s.GetContent() == NULL) 1072 if (s.GetContent() == NULL)
962 { 1073 {
978 if (!PyArg_ParseTuple(args, "s", &arg0)) 1089 if (!PyArg_ParseTuple(args, "s", &arg0))
979 { 1090 {
980 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 1091 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
981 return NULL; 1092 return NULL;
982 } 1093 }
1094
983 OrthancPlugins::OrthancString s; 1095 OrthancPlugins::OrthancString s;
984 s.Assign(OrthancPluginLookupSeries(OrthancPlugins::GetGlobalContext(), arg0)); 1096 s.Assign(OrthancPluginLookupSeries(OrthancPlugins::GetGlobalContext(), arg0));
985 1097
986 if (s.GetContent() == NULL) 1098 if (s.GetContent() == NULL)
987 { 1099 {
1003 if (!PyArg_ParseTuple(args, "s", &arg0)) 1115 if (!PyArg_ParseTuple(args, "s", &arg0))
1004 { 1116 {
1005 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 1117 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
1006 return NULL; 1118 return NULL;
1007 } 1119 }
1120
1008 OrthancPlugins::OrthancString s; 1121 OrthancPlugins::OrthancString s;
1009 s.Assign(OrthancPluginLookupStudy(OrthancPlugins::GetGlobalContext(), arg0)); 1122 s.Assign(OrthancPluginLookupStudy(OrthancPlugins::GetGlobalContext(), arg0));
1010 1123
1011 if (s.GetContent() == NULL) 1124 if (s.GetContent() == NULL)
1012 { 1125 {
1028 if (!PyArg_ParseTuple(args, "s", &arg0)) 1141 if (!PyArg_ParseTuple(args, "s", &arg0))
1029 { 1142 {
1030 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 1143 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
1031 return NULL; 1144 return NULL;
1032 } 1145 }
1146
1033 OrthancPlugins::OrthancString s; 1147 OrthancPlugins::OrthancString s;
1034 s.Assign(OrthancPluginLookupStudyWithAccessionNumber(OrthancPlugins::GetGlobalContext(), arg0)); 1148 s.Assign(OrthancPluginLookupStudyWithAccessionNumber(OrthancPlugins::GetGlobalContext(), arg0));
1035 1149
1036 if (s.GetContent() == NULL) 1150 if (s.GetContent() == NULL)
1037 { 1151 {
1053 if (!PyArg_ParseTuple(args, "s", &arg0)) 1167 if (!PyArg_ParseTuple(args, "s", &arg0))
1054 { 1168 {
1055 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 1169 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
1056 return NULL; 1170 return NULL;
1057 } 1171 }
1172
1058 OrthancPlugins::MemoryBuffer buffer; 1173 OrthancPlugins::MemoryBuffer buffer;
1059 OrthancPluginErrorCode code = OrthancPluginReadFile(OrthancPlugins::GetGlobalContext(), *buffer, arg0); 1174 OrthancPluginErrorCode code = OrthancPluginReadFile(OrthancPlugins::GetGlobalContext(), *buffer, arg0);
1060 1175
1061 if (code == OrthancPluginErrorCode_Success) 1176 if (code == OrthancPluginErrorCode_Success)
1062 { 1177 {
1083 if (!PyArg_ParseTuple(args, "HHlskk", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5)) 1198 if (!PyArg_ParseTuple(args, "HHlskk", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5))
1084 { 1199 {
1085 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (6 arguments expected)"); 1200 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (6 arguments expected)");
1086 return NULL; 1201 return NULL;
1087 } 1202 }
1203
1088 OrthancPluginErrorCode code = OrthancPluginRegisterDictionaryTag(OrthancPlugins::GetGlobalContext(), arg0, arg1, static_cast<OrthancPluginValueRepresentation>(arg2), arg3, arg4, arg5); 1204 OrthancPluginErrorCode code = OrthancPluginRegisterDictionaryTag(OrthancPlugins::GetGlobalContext(), arg0, arg1, static_cast<OrthancPluginValueRepresentation>(arg2), arg3, arg4, arg5);
1089 1205
1090 1206
1091 if (code == OrthancPluginErrorCode_Success) 1207 if (code == OrthancPluginErrorCode_Success)
1092 { 1208 {
1111 if (!PyArg_ParseTuple(args, "lHs", &arg0, &arg1, &arg2)) 1227 if (!PyArg_ParseTuple(args, "lHs", &arg0, &arg1, &arg2))
1112 { 1228 {
1113 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); 1229 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)");
1114 return NULL; 1230 return NULL;
1115 } 1231 }
1232
1116 OrthancPluginErrorCode code = OrthancPluginRegisterErrorCode(OrthancPlugins::GetGlobalContext(), arg0, arg1, arg2); 1233 OrthancPluginErrorCode code = OrthancPluginRegisterErrorCode(OrthancPlugins::GetGlobalContext(), arg0, arg1, arg2);
1117 1234
1118 1235
1119 if (code == OrthancPluginErrorCode_Success) 1236 if (code == OrthancPluginErrorCode_Success)
1120 { 1237 {
1143 if (!PyArg_ParseTuple(args, "HHlskks", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6)) 1260 if (!PyArg_ParseTuple(args, "HHlskks", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6))
1144 { 1261 {
1145 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (7 arguments expected)"); 1262 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (7 arguments expected)");
1146 return NULL; 1263 return NULL;
1147 } 1264 }
1265
1148 OrthancPluginErrorCode code = OrthancPluginRegisterPrivateDictionaryTag(OrthancPlugins::GetGlobalContext(), arg0, arg1, static_cast<OrthancPluginValueRepresentation>(arg2), arg3, arg4, arg5, arg6); 1266 OrthancPluginErrorCode code = OrthancPluginRegisterPrivateDictionaryTag(OrthancPlugins::GetGlobalContext(), arg0, arg1, static_cast<OrthancPluginValueRepresentation>(arg2), arg3, arg4, arg5, arg6);
1149 1267
1150 1268
1151 if (code == OrthancPluginErrorCode_Success) 1269 if (code == OrthancPluginErrorCode_Success)
1152 { 1270 {
1169 if (!PyArg_ParseTuple(args, "s", &arg0)) 1287 if (!PyArg_ParseTuple(args, "s", &arg0))
1170 { 1288 {
1171 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 1289 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
1172 return NULL; 1290 return NULL;
1173 } 1291 }
1292
1174 OrthancPluginErrorCode code = OrthancPluginRestApiDelete(OrthancPlugins::GetGlobalContext(), arg0); 1293 OrthancPluginErrorCode code = OrthancPluginRestApiDelete(OrthancPlugins::GetGlobalContext(), arg0);
1175 1294
1176 1295
1177 if (code == OrthancPluginErrorCode_Success) 1296 if (code == OrthancPluginErrorCode_Success)
1178 { 1297 {
1195 if (!PyArg_ParseTuple(args, "s", &arg0)) 1314 if (!PyArg_ParseTuple(args, "s", &arg0))
1196 { 1315 {
1197 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 1316 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
1198 return NULL; 1317 return NULL;
1199 } 1318 }
1319
1200 OrthancPluginErrorCode code = OrthancPluginRestApiDeleteAfterPlugins(OrthancPlugins::GetGlobalContext(), arg0); 1320 OrthancPluginErrorCode code = OrthancPluginRestApiDeleteAfterPlugins(OrthancPlugins::GetGlobalContext(), arg0);
1201 1321
1202 1322
1203 if (code == OrthancPluginErrorCode_Success) 1323 if (code == OrthancPluginErrorCode_Success)
1204 { 1324 {
1221 if (!PyArg_ParseTuple(args, "s", &arg0)) 1341 if (!PyArg_ParseTuple(args, "s", &arg0))
1222 { 1342 {
1223 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 1343 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
1224 return NULL; 1344 return NULL;
1225 } 1345 }
1346
1226 OrthancPlugins::MemoryBuffer buffer; 1347 OrthancPlugins::MemoryBuffer buffer;
1227 OrthancPluginErrorCode code = OrthancPluginRestApiGet(OrthancPlugins::GetGlobalContext(), *buffer, arg0); 1348 OrthancPluginErrorCode code = OrthancPluginRestApiGet(OrthancPlugins::GetGlobalContext(), *buffer, arg0);
1228 1349
1229 if (code == OrthancPluginErrorCode_Success) 1350 if (code == OrthancPluginErrorCode_Success)
1230 { 1351 {
1246 if (!PyArg_ParseTuple(args, "s", &arg0)) 1367 if (!PyArg_ParseTuple(args, "s", &arg0))
1247 { 1368 {
1248 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 1369 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
1249 return NULL; 1370 return NULL;
1250 } 1371 }
1372
1251 OrthancPlugins::MemoryBuffer buffer; 1373 OrthancPlugins::MemoryBuffer buffer;
1252 OrthancPluginErrorCode code = OrthancPluginRestApiGetAfterPlugins(OrthancPlugins::GetGlobalContext(), *buffer, arg0); 1374 OrthancPluginErrorCode code = OrthancPluginRestApiGetAfterPlugins(OrthancPlugins::GetGlobalContext(), *buffer, arg0);
1253 1375
1254 if (code == OrthancPluginErrorCode_Success) 1376 if (code == OrthancPluginErrorCode_Success)
1255 { 1377 {
1272 if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1)) 1394 if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1))
1273 { 1395 {
1274 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); 1396 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
1275 return NULL; 1397 return NULL;
1276 } 1398 }
1399
1277 OrthancPlugins::MemoryBuffer buffer; 1400 OrthancPlugins::MemoryBuffer buffer;
1278 OrthancPluginErrorCode code = OrthancPluginRestApiPost(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1.buf, arg1.len); 1401 OrthancPluginErrorCode code = OrthancPluginRestApiPost(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1.buf, arg1.len);
1279 PyBuffer_Release(&arg1); 1402 PyBuffer_Release(&arg1);
1280 if (code == OrthancPluginErrorCode_Success) 1403 if (code == OrthancPluginErrorCode_Success)
1281 { 1404 {
1298 if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1)) 1421 if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1))
1299 { 1422 {
1300 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); 1423 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
1301 return NULL; 1424 return NULL;
1302 } 1425 }
1426
1303 OrthancPlugins::MemoryBuffer buffer; 1427 OrthancPlugins::MemoryBuffer buffer;
1304 OrthancPluginErrorCode code = OrthancPluginRestApiPostAfterPlugins(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1.buf, arg1.len); 1428 OrthancPluginErrorCode code = OrthancPluginRestApiPostAfterPlugins(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1.buf, arg1.len);
1305 PyBuffer_Release(&arg1); 1429 PyBuffer_Release(&arg1);
1306 if (code == OrthancPluginErrorCode_Success) 1430 if (code == OrthancPluginErrorCode_Success)
1307 { 1431 {
1324 if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1)) 1448 if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1))
1325 { 1449 {
1326 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); 1450 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
1327 return NULL; 1451 return NULL;
1328 } 1452 }
1453
1329 OrthancPlugins::MemoryBuffer buffer; 1454 OrthancPlugins::MemoryBuffer buffer;
1330 OrthancPluginErrorCode code = OrthancPluginRestApiPut(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1.buf, arg1.len); 1455 OrthancPluginErrorCode code = OrthancPluginRestApiPut(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1.buf, arg1.len);
1331 PyBuffer_Release(&arg1); 1456 PyBuffer_Release(&arg1);
1332 if (code == OrthancPluginErrorCode_Success) 1457 if (code == OrthancPluginErrorCode_Success)
1333 { 1458 {
1350 if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1)) 1475 if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1))
1351 { 1476 {
1352 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); 1477 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
1353 return NULL; 1478 return NULL;
1354 } 1479 }
1480
1355 OrthancPlugins::MemoryBuffer buffer; 1481 OrthancPlugins::MemoryBuffer buffer;
1356 OrthancPluginErrorCode code = OrthancPluginRestApiPutAfterPlugins(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1.buf, arg1.len); 1482 OrthancPluginErrorCode code = OrthancPluginRestApiPutAfterPlugins(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1.buf, arg1.len);
1357 PyBuffer_Release(&arg1); 1483 PyBuffer_Release(&arg1);
1358 if (code == OrthancPluginErrorCode_Success) 1484 if (code == OrthancPluginErrorCode_Success)
1359 { 1485 {
1375 if (!PyArg_ParseTuple(args, "s", &arg0)) 1501 if (!PyArg_ParseTuple(args, "s", &arg0))
1376 { 1502 {
1377 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 1503 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
1378 return NULL; 1504 return NULL;
1379 } 1505 }
1506
1380 OrthancPluginSetDescription(OrthancPlugins::GetGlobalContext(), arg0); 1507 OrthancPluginSetDescription(OrthancPlugins::GetGlobalContext(), arg0);
1381 1508
1382 1509
1383 Py_INCREF(Py_None); 1510 Py_INCREF(Py_None);
1384 return Py_None; 1511 return Py_None;
1394 if (!PyArg_ParseTuple(args, "ls", &arg0, &arg1)) 1521 if (!PyArg_ParseTuple(args, "ls", &arg0, &arg1))
1395 { 1522 {
1396 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); 1523 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
1397 return NULL; 1524 return NULL;
1398 } 1525 }
1526
1399 OrthancPluginErrorCode code = OrthancPluginSetGlobalProperty(OrthancPlugins::GetGlobalContext(), arg0, arg1); 1527 OrthancPluginErrorCode code = OrthancPluginSetGlobalProperty(OrthancPlugins::GetGlobalContext(), arg0, arg1);
1400 1528
1401 1529
1402 if (code == OrthancPluginErrorCode_Success) 1530 if (code == OrthancPluginErrorCode_Success)
1403 { 1531 {
1422 if (!PyArg_ParseTuple(args, "sfl", &arg0, &arg1, &arg2)) 1550 if (!PyArg_ParseTuple(args, "sfl", &arg0, &arg1, &arg2))
1423 { 1551 {
1424 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); 1552 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)");
1425 return NULL; 1553 return NULL;
1426 } 1554 }
1555
1427 OrthancPluginSetMetricsValue(OrthancPlugins::GetGlobalContext(), arg0, arg1, static_cast<OrthancPluginMetricsType>(arg2)); 1556 OrthancPluginSetMetricsValue(OrthancPlugins::GetGlobalContext(), arg0, arg1, static_cast<OrthancPluginMetricsType>(arg2));
1428 1557
1429 1558
1430 Py_INCREF(Py_None); 1559 Py_INCREF(Py_None);
1431 return Py_None; 1560 return Py_None;
1440 if (!PyArg_ParseTuple(args, "s", &arg0)) 1569 if (!PyArg_ParseTuple(args, "s", &arg0))
1441 { 1570 {
1442 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 1571 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
1443 return NULL; 1572 return NULL;
1444 } 1573 }
1574
1445 OrthancPluginSetRootUri(OrthancPlugins::GetGlobalContext(), arg0); 1575 OrthancPluginSetRootUri(OrthancPlugins::GetGlobalContext(), arg0);
1446 1576
1447 1577
1448 Py_INCREF(Py_None); 1578 Py_INCREF(Py_None);
1449 return Py_None; 1579 return Py_None;
1459 if (!PyArg_ParseTuple(args, "s*s", &arg0, &arg2)) 1589 if (!PyArg_ParseTuple(args, "s*s", &arg0, &arg2))
1460 { 1590 {
1461 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); 1591 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
1462 return NULL; 1592 return NULL;
1463 } 1593 }
1594
1464 // This is the case of a constructor 1595 // This is the case of a constructor
1465 OrthancPluginDicomInstance* obj = OrthancPluginTranscodeDicomInstance(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len, arg2); 1596 OrthancPluginDicomInstance* obj = OrthancPluginTranscodeDicomInstance(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len, arg2);
1466 PyBuffer_Release(&arg0); 1597 PyBuffer_Release(&arg0);
1467 if (obj == NULL) 1598 if (obj == NULL)
1468 { 1599 {
1488 if (!PyArg_ParseTuple(args, "s*l", &arg0, &arg2)) 1619 if (!PyArg_ParseTuple(args, "s*l", &arg0, &arg2))
1489 { 1620 {
1490 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); 1621 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
1491 return NULL; 1622 return NULL;
1492 } 1623 }
1624
1493 // This is the case of a constructor 1625 // This is the case of a constructor
1494 OrthancPluginImage* obj = OrthancPluginUncompressImage(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len, static_cast<OrthancPluginImageFormat>(arg2)); 1626 OrthancPluginImage* obj = OrthancPluginUncompressImage(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len, static_cast<OrthancPluginImageFormat>(arg2));
1495 PyBuffer_Release(&arg0); 1627 PyBuffer_Release(&arg0);
1496 if (obj == NULL) 1628 if (obj == NULL)
1497 { 1629 {
1517 if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1)) 1649 if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1))
1518 { 1650 {
1519 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); 1651 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
1520 return NULL; 1652 return NULL;
1521 } 1653 }
1654
1522 OrthancPluginErrorCode code = OrthancPluginWriteFile(OrthancPlugins::GetGlobalContext(), arg0, arg1.buf, arg1.len); 1655 OrthancPluginErrorCode code = OrthancPluginWriteFile(OrthancPlugins::GetGlobalContext(), arg0, arg1.buf, arg1.len);
1523 PyBuffer_Release(&arg1); 1656 PyBuffer_Release(&arg1);
1524 1657
1525 if (code == OrthancPluginErrorCode_Success) 1658 if (code == OrthancPluginErrorCode_Success)
1526 { 1659 {
1551 "Generated from C function OrthancPluginCompressPngImage()" }, 1684 "Generated from C function OrthancPluginCompressPngImage()" },
1552 { "ComputeMd5", sdk_OrthancPluginComputeMd5, METH_VARARGS, 1685 { "ComputeMd5", sdk_OrthancPluginComputeMd5, METH_VARARGS,
1553 "Generated from C function OrthancPluginComputeMd5()" }, 1686 "Generated from C function OrthancPluginComputeMd5()" },
1554 { "ComputeSha1", sdk_OrthancPluginComputeSha1, METH_VARARGS, 1687 { "ComputeSha1", sdk_OrthancPluginComputeSha1, METH_VARARGS,
1555 "Generated from C function OrthancPluginComputeSha1()" }, 1688 "Generated from C function OrthancPluginComputeSha1()" },
1689 { "CreateDicom", sdk_OrthancPluginCreateDicom, METH_VARARGS,
1690 "Generated from C function OrthancPluginCreateDicom()" },
1691 { "CreateDicom2", sdk_OrthancPluginCreateDicom2, METH_VARARGS,
1692 "Generated from C function OrthancPluginCreateDicom2()" },
1556 { "CreateDicomInstance", sdk_OrthancPluginCreateDicomInstance, METH_VARARGS, 1693 { "CreateDicomInstance", sdk_OrthancPluginCreateDicomInstance, METH_VARARGS,
1557 "Generated from C function OrthancPluginCreateDicomInstance()" }, 1694 "Generated from C function OrthancPluginCreateDicomInstance()" },
1558 { "CreateFindMatcher", sdk_OrthancPluginCreateFindMatcher, METH_VARARGS, 1695 { "CreateFindMatcher", sdk_OrthancPluginCreateFindMatcher, METH_VARARGS,
1559 "Generated from C function OrthancPluginCreateFindMatcher()" }, 1696 "Generated from C function OrthancPluginCreateFindMatcher()" },
1560 { "CreateImage", sdk_OrthancPluginCreateImage, METH_VARARGS, 1697 { "CreateImage", sdk_OrthancPluginCreateImage, METH_VARARGS,