Mercurial > hg > orthanc-python
comparison Sources/Autogenerated/sdk_GlobalFunctions.impl.h @ 1:fef9a239df5c
adding auto-generated files
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 26 Mar 2020 18:50:10 +0100 |
parents | |
children | b2bbb516056e |
comparison
equal
deleted
inserted
replaced
0:7ed502b17b8f | 1:fef9a239df5c |
---|---|
1 /** | |
2 * Python plugin for Orthanc | |
3 * Copyright (C) 2017-2020 Osimis S.A., Belgium | |
4 * | |
5 * This program is free software: you can redistribute it and/or | |
6 * modify it under the terms of the GNU Affero General Public License | |
7 * as published by the Free Software Foundation, either version 3 of | |
8 * the License, or (at your option) any later version. | |
9 * | |
10 * This program is distributed in the hope that it will be useful, but | |
11 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 * Affero General Public License for more details. | |
14 * | |
15 * You should have received a copy of the GNU Affero General Public License | |
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
17 **/ | |
18 | |
19 | |
20 static PyObject* sdk_OrthancPluginCheckVersionAdvanced(PyObject* module, PyObject* args) | |
21 { | |
22 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginCheckVersionAdvanced()"); | |
23 | |
24 int arg0 = 0; | |
25 int arg1 = 0; | |
26 int arg2 = 0; | |
27 | |
28 if (!PyArg_ParseTuple(args, "iii", &arg0, &arg1, &arg2)) | |
29 { | |
30 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
31 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); | |
32 return NULL; | |
33 } | |
34 long value = OrthancPluginCheckVersionAdvanced(OrthancPlugins::GetGlobalContext(), arg0, arg1, arg2); | |
35 | |
36 return PyLong_FromLong(value); | |
37 } | |
38 | |
39 static PyObject* sdk_OrthancPluginCheckVersion(PyObject* module, PyObject* args) | |
40 { | |
41 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginCheckVersion()"); | |
42 | |
43 | |
44 long value = OrthancPluginCheckVersion(OrthancPlugins::GetGlobalContext()); | |
45 | |
46 return PyLong_FromLong(value); | |
47 } | |
48 | |
49 static PyObject* sdk_OrthancPluginLogError(PyObject* module, PyObject* args) | |
50 { | |
51 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginLogError()"); | |
52 | |
53 const char* arg0 = NULL; | |
54 | |
55 if (!PyArg_ParseTuple(args, "s", &arg0)) | |
56 { | |
57 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
58 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
59 return NULL; | |
60 } | |
61 OrthancPluginLogError(OrthancPlugins::GetGlobalContext(), arg0); | |
62 | |
63 | |
64 Py_INCREF(Py_None); | |
65 return Py_None; | |
66 } | |
67 | |
68 static PyObject* sdk_OrthancPluginLogWarning(PyObject* module, PyObject* args) | |
69 { | |
70 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginLogWarning()"); | |
71 | |
72 const char* arg0 = NULL; | |
73 | |
74 if (!PyArg_ParseTuple(args, "s", &arg0)) | |
75 { | |
76 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
77 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
78 return NULL; | |
79 } | |
80 OrthancPluginLogWarning(OrthancPlugins::GetGlobalContext(), arg0); | |
81 | |
82 | |
83 Py_INCREF(Py_None); | |
84 return Py_None; | |
85 } | |
86 | |
87 static PyObject* sdk_OrthancPluginLogInfo(PyObject* module, PyObject* args) | |
88 { | |
89 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginLogInfo()"); | |
90 | |
91 const char* arg0 = NULL; | |
92 | |
93 if (!PyArg_ParseTuple(args, "s", &arg0)) | |
94 { | |
95 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
96 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
97 return NULL; | |
98 } | |
99 OrthancPluginLogInfo(OrthancPlugins::GetGlobalContext(), arg0); | |
100 | |
101 | |
102 Py_INCREF(Py_None); | |
103 return Py_None; | |
104 } | |
105 | |
106 static PyObject* sdk_OrthancPluginGetDicomForInstance(PyObject* module, PyObject* args) | |
107 { | |
108 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginGetDicomForInstance()"); | |
109 | |
110 const char* arg0 = NULL; | |
111 | |
112 if (!PyArg_ParseTuple(args, "s", &arg0)) | |
113 { | |
114 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
115 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
116 return NULL; | |
117 } | |
118 OrthancPlugins::MemoryBuffer buffer; | |
119 OrthancPluginErrorCode code = OrthancPluginGetDicomForInstance(OrthancPlugins::GetGlobalContext(), *buffer, arg0); | |
120 | |
121 if (code == OrthancPluginErrorCode_Success) | |
122 { | |
123 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); | |
124 } | |
125 else | |
126 { | |
127 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
128 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
129 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
130 return NULL; | |
131 } | |
132 } | |
133 | |
134 static PyObject* sdk_OrthancPluginRestApiGet(PyObject* module, PyObject* args) | |
135 { | |
136 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginRestApiGet()"); | |
137 | |
138 const char* arg0 = NULL; | |
139 | |
140 if (!PyArg_ParseTuple(args, "s", &arg0)) | |
141 { | |
142 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
143 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
144 return NULL; | |
145 } | |
146 OrthancPlugins::MemoryBuffer buffer; | |
147 OrthancPluginErrorCode code = OrthancPluginRestApiGet(OrthancPlugins::GetGlobalContext(), *buffer, arg0); | |
148 | |
149 if (code == OrthancPluginErrorCode_Success) | |
150 { | |
151 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); | |
152 } | |
153 else | |
154 { | |
155 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
156 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
157 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
158 return NULL; | |
159 } | |
160 } | |
161 | |
162 static PyObject* sdk_OrthancPluginRestApiGetAfterPlugins(PyObject* module, PyObject* args) | |
163 { | |
164 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginRestApiGetAfterPlugins()"); | |
165 | |
166 const char* arg0 = NULL; | |
167 | |
168 if (!PyArg_ParseTuple(args, "s", &arg0)) | |
169 { | |
170 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
171 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
172 return NULL; | |
173 } | |
174 OrthancPlugins::MemoryBuffer buffer; | |
175 OrthancPluginErrorCode code = OrthancPluginRestApiGetAfterPlugins(OrthancPlugins::GetGlobalContext(), *buffer, arg0); | |
176 | |
177 if (code == OrthancPluginErrorCode_Success) | |
178 { | |
179 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); | |
180 } | |
181 else | |
182 { | |
183 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
184 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
185 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
186 return NULL; | |
187 } | |
188 } | |
189 | |
190 static PyObject* sdk_OrthancPluginRestApiPost(PyObject* module, PyObject* args) | |
191 { | |
192 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginRestApiPost()"); | |
193 | |
194 const char* arg0 = NULL; | |
195 Py_buffer arg1; | |
196 | |
197 if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1)) | |
198 { | |
199 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
200 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); | |
201 return NULL; | |
202 } | |
203 OrthancPlugins::MemoryBuffer buffer; | |
204 OrthancPluginErrorCode code = OrthancPluginRestApiPost(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1.buf, arg1.len); | |
205 PyBuffer_Release(&arg1); | |
206 if (code == OrthancPluginErrorCode_Success) | |
207 { | |
208 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); | |
209 } | |
210 else | |
211 { | |
212 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
213 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
214 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
215 return NULL; | |
216 } | |
217 } | |
218 | |
219 static PyObject* sdk_OrthancPluginRestApiPostAfterPlugins(PyObject* module, PyObject* args) | |
220 { | |
221 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginRestApiPostAfterPlugins()"); | |
222 | |
223 const char* arg0 = NULL; | |
224 Py_buffer arg1; | |
225 | |
226 if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1)) | |
227 { | |
228 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
229 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); | |
230 return NULL; | |
231 } | |
232 OrthancPlugins::MemoryBuffer buffer; | |
233 OrthancPluginErrorCode code = OrthancPluginRestApiPostAfterPlugins(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1.buf, arg1.len); | |
234 PyBuffer_Release(&arg1); | |
235 if (code == OrthancPluginErrorCode_Success) | |
236 { | |
237 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); | |
238 } | |
239 else | |
240 { | |
241 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
242 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
243 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
244 return NULL; | |
245 } | |
246 } | |
247 | |
248 static PyObject* sdk_OrthancPluginRestApiDelete(PyObject* module, PyObject* args) | |
249 { | |
250 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginRestApiDelete()"); | |
251 | |
252 const char* arg0 = NULL; | |
253 | |
254 if (!PyArg_ParseTuple(args, "s", &arg0)) | |
255 { | |
256 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
257 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
258 return NULL; | |
259 } | |
260 OrthancPluginErrorCode code = OrthancPluginRestApiDelete(OrthancPlugins::GetGlobalContext(), arg0); | |
261 | |
262 | |
263 if (code == OrthancPluginErrorCode_Success) | |
264 { | |
265 Py_INCREF(Py_None); | |
266 return Py_None; | |
267 } | |
268 else | |
269 { | |
270 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
271 //PythonLock::RaiseException(module, code); | |
272 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
273 return NULL; | |
274 } | |
275 } | |
276 | |
277 static PyObject* sdk_OrthancPluginRestApiDeleteAfterPlugins(PyObject* module, PyObject* args) | |
278 { | |
279 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginRestApiDeleteAfterPlugins()"); | |
280 | |
281 const char* arg0 = NULL; | |
282 | |
283 if (!PyArg_ParseTuple(args, "s", &arg0)) | |
284 { | |
285 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
286 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
287 return NULL; | |
288 } | |
289 OrthancPluginErrorCode code = OrthancPluginRestApiDeleteAfterPlugins(OrthancPlugins::GetGlobalContext(), arg0); | |
290 | |
291 | |
292 if (code == OrthancPluginErrorCode_Success) | |
293 { | |
294 Py_INCREF(Py_None); | |
295 return Py_None; | |
296 } | |
297 else | |
298 { | |
299 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
300 //PythonLock::RaiseException(module, code); | |
301 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
302 return NULL; | |
303 } | |
304 } | |
305 | |
306 static PyObject* sdk_OrthancPluginRestApiPut(PyObject* module, PyObject* args) | |
307 { | |
308 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginRestApiPut()"); | |
309 | |
310 const char* arg0 = NULL; | |
311 Py_buffer arg1; | |
312 | |
313 if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1)) | |
314 { | |
315 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
316 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); | |
317 return NULL; | |
318 } | |
319 OrthancPlugins::MemoryBuffer buffer; | |
320 OrthancPluginErrorCode code = OrthancPluginRestApiPut(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1.buf, arg1.len); | |
321 PyBuffer_Release(&arg1); | |
322 if (code == OrthancPluginErrorCode_Success) | |
323 { | |
324 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); | |
325 } | |
326 else | |
327 { | |
328 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
329 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
330 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
331 return NULL; | |
332 } | |
333 } | |
334 | |
335 static PyObject* sdk_OrthancPluginRestApiPutAfterPlugins(PyObject* module, PyObject* args) | |
336 { | |
337 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginRestApiPutAfterPlugins()"); | |
338 | |
339 const char* arg0 = NULL; | |
340 Py_buffer arg1; | |
341 | |
342 if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1)) | |
343 { | |
344 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
345 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); | |
346 return NULL; | |
347 } | |
348 OrthancPlugins::MemoryBuffer buffer; | |
349 OrthancPluginErrorCode code = OrthancPluginRestApiPutAfterPlugins(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1.buf, arg1.len); | |
350 PyBuffer_Release(&arg1); | |
351 if (code == OrthancPluginErrorCode_Success) | |
352 { | |
353 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); | |
354 } | |
355 else | |
356 { | |
357 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
358 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
359 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
360 return NULL; | |
361 } | |
362 } | |
363 | |
364 static PyObject* sdk_OrthancPluginLookupPatient(PyObject* module, PyObject* args) | |
365 { | |
366 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginLookupPatient()"); | |
367 | |
368 const char* arg0 = NULL; | |
369 | |
370 if (!PyArg_ParseTuple(args, "s", &arg0)) | |
371 { | |
372 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
373 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
374 return NULL; | |
375 } | |
376 OrthancPlugins::OrthancString s; | |
377 s.Assign(OrthancPluginLookupPatient(OrthancPlugins::GetGlobalContext(), arg0)); | |
378 | |
379 if (s.GetContent() == NULL) | |
380 { | |
381 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
382 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
383 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
384 return NULL; | |
385 } | |
386 else | |
387 { | |
388 return PyUnicode_FromString(s.GetContent()); | |
389 } | |
390 } | |
391 | |
392 static PyObject* sdk_OrthancPluginLookupStudy(PyObject* module, PyObject* args) | |
393 { | |
394 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginLookupStudy()"); | |
395 | |
396 const char* arg0 = NULL; | |
397 | |
398 if (!PyArg_ParseTuple(args, "s", &arg0)) | |
399 { | |
400 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
401 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
402 return NULL; | |
403 } | |
404 OrthancPlugins::OrthancString s; | |
405 s.Assign(OrthancPluginLookupStudy(OrthancPlugins::GetGlobalContext(), arg0)); | |
406 | |
407 if (s.GetContent() == NULL) | |
408 { | |
409 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
410 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
411 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
412 return NULL; | |
413 } | |
414 else | |
415 { | |
416 return PyUnicode_FromString(s.GetContent()); | |
417 } | |
418 } | |
419 | |
420 static PyObject* sdk_OrthancPluginLookupStudyWithAccessionNumber(PyObject* module, PyObject* args) | |
421 { | |
422 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginLookupStudyWithAccessionNumber()"); | |
423 | |
424 const char* arg0 = NULL; | |
425 | |
426 if (!PyArg_ParseTuple(args, "s", &arg0)) | |
427 { | |
428 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
429 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
430 return NULL; | |
431 } | |
432 OrthancPlugins::OrthancString s; | |
433 s.Assign(OrthancPluginLookupStudyWithAccessionNumber(OrthancPlugins::GetGlobalContext(), arg0)); | |
434 | |
435 if (s.GetContent() == NULL) | |
436 { | |
437 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
438 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
439 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
440 return NULL; | |
441 } | |
442 else | |
443 { | |
444 return PyUnicode_FromString(s.GetContent()); | |
445 } | |
446 } | |
447 | |
448 static PyObject* sdk_OrthancPluginLookupSeries(PyObject* module, PyObject* args) | |
449 { | |
450 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginLookupSeries()"); | |
451 | |
452 const char* arg0 = NULL; | |
453 | |
454 if (!PyArg_ParseTuple(args, "s", &arg0)) | |
455 { | |
456 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
457 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
458 return NULL; | |
459 } | |
460 OrthancPlugins::OrthancString s; | |
461 s.Assign(OrthancPluginLookupSeries(OrthancPlugins::GetGlobalContext(), arg0)); | |
462 | |
463 if (s.GetContent() == NULL) | |
464 { | |
465 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
466 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
467 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
468 return NULL; | |
469 } | |
470 else | |
471 { | |
472 return PyUnicode_FromString(s.GetContent()); | |
473 } | |
474 } | |
475 | |
476 static PyObject* sdk_OrthancPluginLookupInstance(PyObject* module, PyObject* args) | |
477 { | |
478 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginLookupInstance()"); | |
479 | |
480 const char* arg0 = NULL; | |
481 | |
482 if (!PyArg_ParseTuple(args, "s", &arg0)) | |
483 { | |
484 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
485 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
486 return NULL; | |
487 } | |
488 OrthancPlugins::OrthancString s; | |
489 s.Assign(OrthancPluginLookupInstance(OrthancPlugins::GetGlobalContext(), arg0)); | |
490 | |
491 if (s.GetContent() == NULL) | |
492 { | |
493 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
494 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
495 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
496 return NULL; | |
497 } | |
498 else | |
499 { | |
500 return PyUnicode_FromString(s.GetContent()); | |
501 } | |
502 } | |
503 | |
504 static PyObject* sdk_OrthancPluginGetOrthancPath(PyObject* module, PyObject* args) | |
505 { | |
506 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginGetOrthancPath()"); | |
507 | |
508 | |
509 OrthancPlugins::OrthancString s; | |
510 s.Assign(OrthancPluginGetOrthancPath(OrthancPlugins::GetGlobalContext())); | |
511 | |
512 if (s.GetContent() == NULL) | |
513 { | |
514 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
515 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
516 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
517 return NULL; | |
518 } | |
519 else | |
520 { | |
521 return PyUnicode_FromString(s.GetContent()); | |
522 } | |
523 } | |
524 | |
525 static PyObject* sdk_OrthancPluginGetOrthancDirectory(PyObject* module, PyObject* args) | |
526 { | |
527 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginGetOrthancDirectory()"); | |
528 | |
529 | |
530 OrthancPlugins::OrthancString s; | |
531 s.Assign(OrthancPluginGetOrthancDirectory(OrthancPlugins::GetGlobalContext())); | |
532 | |
533 if (s.GetContent() == NULL) | |
534 { | |
535 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
536 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
537 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
538 return NULL; | |
539 } | |
540 else | |
541 { | |
542 return PyUnicode_FromString(s.GetContent()); | |
543 } | |
544 } | |
545 | |
546 static PyObject* sdk_OrthancPluginGetConfigurationPath(PyObject* module, PyObject* args) | |
547 { | |
548 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginGetConfigurationPath()"); | |
549 | |
550 | |
551 OrthancPlugins::OrthancString s; | |
552 s.Assign(OrthancPluginGetConfigurationPath(OrthancPlugins::GetGlobalContext())); | |
553 | |
554 if (s.GetContent() == NULL) | |
555 { | |
556 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
557 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
558 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
559 return NULL; | |
560 } | |
561 else | |
562 { | |
563 return PyUnicode_FromString(s.GetContent()); | |
564 } | |
565 } | |
566 | |
567 static PyObject* sdk_OrthancPluginSetRootUri(PyObject* module, PyObject* args) | |
568 { | |
569 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginSetRootUri()"); | |
570 | |
571 const char* arg0 = NULL; | |
572 | |
573 if (!PyArg_ParseTuple(args, "s", &arg0)) | |
574 { | |
575 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
576 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
577 return NULL; | |
578 } | |
579 OrthancPluginSetRootUri(OrthancPlugins::GetGlobalContext(), arg0); | |
580 | |
581 | |
582 Py_INCREF(Py_None); | |
583 return Py_None; | |
584 } | |
585 | |
586 static PyObject* sdk_OrthancPluginSetDescription(PyObject* module, PyObject* args) | |
587 { | |
588 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginSetDescription()"); | |
589 | |
590 const char* arg0 = NULL; | |
591 | |
592 if (!PyArg_ParseTuple(args, "s", &arg0)) | |
593 { | |
594 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
595 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
596 return NULL; | |
597 } | |
598 OrthancPluginSetDescription(OrthancPlugins::GetGlobalContext(), arg0); | |
599 | |
600 | |
601 Py_INCREF(Py_None); | |
602 return Py_None; | |
603 } | |
604 | |
605 static PyObject* sdk_OrthancPluginExtendOrthancExplorer(PyObject* module, PyObject* args) | |
606 { | |
607 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginExtendOrthancExplorer()"); | |
608 | |
609 const char* arg0 = NULL; | |
610 | |
611 if (!PyArg_ParseTuple(args, "s", &arg0)) | |
612 { | |
613 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
614 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
615 return NULL; | |
616 } | |
617 OrthancPluginExtendOrthancExplorer(OrthancPlugins::GetGlobalContext(), arg0); | |
618 | |
619 | |
620 Py_INCREF(Py_None); | |
621 return Py_None; | |
622 } | |
623 | |
624 static PyObject* sdk_OrthancPluginGetGlobalProperty(PyObject* module, PyObject* args) | |
625 { | |
626 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginGetGlobalProperty()"); | |
627 | |
628 long int arg0 = 0; | |
629 const char* arg1 = NULL; | |
630 | |
631 if (!PyArg_ParseTuple(args, "ls", &arg0, &arg1)) | |
632 { | |
633 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
634 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); | |
635 return NULL; | |
636 } | |
637 OrthancPlugins::OrthancString s; | |
638 s.Assign(OrthancPluginGetGlobalProperty(OrthancPlugins::GetGlobalContext(), arg0, arg1)); | |
639 | |
640 if (s.GetContent() == NULL) | |
641 { | |
642 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
643 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
644 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
645 return NULL; | |
646 } | |
647 else | |
648 { | |
649 return PyUnicode_FromString(s.GetContent()); | |
650 } | |
651 } | |
652 | |
653 static PyObject* sdk_OrthancPluginSetGlobalProperty(PyObject* module, PyObject* args) | |
654 { | |
655 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginSetGlobalProperty()"); | |
656 | |
657 long int arg0 = 0; | |
658 const char* arg1 = NULL; | |
659 | |
660 if (!PyArg_ParseTuple(args, "ls", &arg0, &arg1)) | |
661 { | |
662 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
663 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); | |
664 return NULL; | |
665 } | |
666 OrthancPluginErrorCode code = OrthancPluginSetGlobalProperty(OrthancPlugins::GetGlobalContext(), arg0, arg1); | |
667 | |
668 | |
669 if (code == OrthancPluginErrorCode_Success) | |
670 { | |
671 Py_INCREF(Py_None); | |
672 return Py_None; | |
673 } | |
674 else | |
675 { | |
676 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
677 //PythonLock::RaiseException(module, code); | |
678 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
679 return NULL; | |
680 } | |
681 } | |
682 | |
683 static PyObject* sdk_OrthancPluginGetCommandLineArgumentsCount(PyObject* module, PyObject* args) | |
684 { | |
685 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginGetCommandLineArgumentsCount()"); | |
686 | |
687 | |
688 long value = OrthancPluginGetCommandLineArgumentsCount(OrthancPlugins::GetGlobalContext()); | |
689 | |
690 return PyLong_FromLong(value); | |
691 } | |
692 | |
693 static PyObject* sdk_OrthancPluginGetCommandLineArgument(PyObject* module, PyObject* args) | |
694 { | |
695 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginGetCommandLineArgument()"); | |
696 | |
697 unsigned long arg0 = 0; | |
698 | |
699 if (!PyArg_ParseTuple(args, "k", &arg0)) | |
700 { | |
701 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
702 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
703 return NULL; | |
704 } | |
705 OrthancPlugins::OrthancString s; | |
706 s.Assign(OrthancPluginGetCommandLineArgument(OrthancPlugins::GetGlobalContext(), arg0)); | |
707 | |
708 if (s.GetContent() == NULL) | |
709 { | |
710 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
711 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
712 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
713 return NULL; | |
714 } | |
715 else | |
716 { | |
717 return PyUnicode_FromString(s.GetContent()); | |
718 } | |
719 } | |
720 | |
721 static PyObject* sdk_OrthancPluginGetExpectedDatabaseVersion(PyObject* module, PyObject* args) | |
722 { | |
723 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginGetExpectedDatabaseVersion()"); | |
724 | |
725 | |
726 long value = OrthancPluginGetExpectedDatabaseVersion(OrthancPlugins::GetGlobalContext()); | |
727 | |
728 return PyLong_FromLong(value); | |
729 } | |
730 | |
731 static PyObject* sdk_OrthancPluginGetConfiguration(PyObject* module, PyObject* args) | |
732 { | |
733 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginGetConfiguration()"); | |
734 | |
735 | |
736 OrthancPlugins::OrthancString s; | |
737 s.Assign(OrthancPluginGetConfiguration(OrthancPlugins::GetGlobalContext())); | |
738 | |
739 if (s.GetContent() == NULL) | |
740 { | |
741 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
742 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
743 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
744 return NULL; | |
745 } | |
746 else | |
747 { | |
748 return PyUnicode_FromString(s.GetContent()); | |
749 } | |
750 } | |
751 | |
752 static PyObject* sdk_OrthancPluginBufferCompression(PyObject* module, PyObject* args) | |
753 { | |
754 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginBufferCompression()"); | |
755 | |
756 Py_buffer arg0; | |
757 long int arg2 = 0; | |
758 unsigned char arg3 = 0; | |
759 | |
760 if (!PyArg_ParseTuple(args, "s*lb", &arg0, &arg2, &arg3)) | |
761 { | |
762 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
763 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); | |
764 return NULL; | |
765 } | |
766 OrthancPlugins::MemoryBuffer buffer; | |
767 OrthancPluginErrorCode code = OrthancPluginBufferCompression(OrthancPlugins::GetGlobalContext(), *buffer, arg0.buf, arg0.len, static_cast<OrthancPluginCompressionType>(arg2), arg3); | |
768 PyBuffer_Release(&arg0); | |
769 if (code == OrthancPluginErrorCode_Success) | |
770 { | |
771 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); | |
772 } | |
773 else | |
774 { | |
775 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
776 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
777 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
778 return NULL; | |
779 } | |
780 } | |
781 | |
782 static PyObject* sdk_OrthancPluginReadFile(PyObject* module, PyObject* args) | |
783 { | |
784 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginReadFile()"); | |
785 | |
786 const char* arg0 = NULL; | |
787 | |
788 if (!PyArg_ParseTuple(args, "s", &arg0)) | |
789 { | |
790 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
791 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
792 return NULL; | |
793 } | |
794 OrthancPlugins::MemoryBuffer buffer; | |
795 OrthancPluginErrorCode code = OrthancPluginReadFile(OrthancPlugins::GetGlobalContext(), *buffer, arg0); | |
796 | |
797 if (code == OrthancPluginErrorCode_Success) | |
798 { | |
799 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); | |
800 } | |
801 else | |
802 { | |
803 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
804 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
805 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
806 return NULL; | |
807 } | |
808 } | |
809 | |
810 static PyObject* sdk_OrthancPluginWriteFile(PyObject* module, PyObject* args) | |
811 { | |
812 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginWriteFile()"); | |
813 | |
814 const char* arg0 = NULL; | |
815 Py_buffer arg1; | |
816 | |
817 if (!PyArg_ParseTuple(args, "ss*", &arg0, &arg1)) | |
818 { | |
819 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
820 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); | |
821 return NULL; | |
822 } | |
823 OrthancPluginErrorCode code = OrthancPluginWriteFile(OrthancPlugins::GetGlobalContext(), arg0, arg1.buf, arg1.len); | |
824 PyBuffer_Release(&arg1); | |
825 | |
826 if (code == OrthancPluginErrorCode_Success) | |
827 { | |
828 Py_INCREF(Py_None); | |
829 return Py_None; | |
830 } | |
831 else | |
832 { | |
833 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
834 //PythonLock::RaiseException(module, code); | |
835 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
836 return NULL; | |
837 } | |
838 } | |
839 | |
840 static PyObject* sdk_OrthancPluginGetErrorDescription(PyObject* module, PyObject* args) | |
841 { | |
842 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginGetErrorDescription()"); | |
843 | |
844 long int arg0 = 0; | |
845 | |
846 if (!PyArg_ParseTuple(args, "l", &arg0)) | |
847 { | |
848 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
849 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
850 return NULL; | |
851 } | |
852 const char* s = OrthancPluginGetErrorDescription(OrthancPlugins::GetGlobalContext(), static_cast<OrthancPluginErrorCode>(arg0)); | |
853 | |
854 if (s == NULL) | |
855 { | |
856 Py_INCREF(Py_None); | |
857 return Py_None; | |
858 } | |
859 else | |
860 { | |
861 return PyUnicode_FromString(s); | |
862 } | |
863 } | |
864 | |
865 static PyObject* sdk_OrthancPluginUncompressImage(PyObject* module, PyObject* args) | |
866 { | |
867 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginUncompressImage()"); | |
868 | |
869 Py_buffer arg0; | |
870 long int arg2 = 0; | |
871 | |
872 if (!PyArg_ParseTuple(args, "s*l", &arg0, &arg2)) | |
873 { | |
874 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
875 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); | |
876 return NULL; | |
877 } | |
878 // This is the case of a constructor | |
879 OrthancPluginImage* obj = OrthancPluginUncompressImage(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len, static_cast<OrthancPluginImageFormat>(arg2)); | |
880 PyBuffer_Release(&arg0); | |
881 if (obj == NULL) | |
882 { | |
883 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
884 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
885 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
886 return NULL; | |
887 } | |
888 else | |
889 { | |
890 PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */); | |
891 PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginImage_Type, argList); | |
892 Py_DECREF(argList); | |
893 return python; | |
894 } | |
895 } | |
896 | |
897 static PyObject* sdk_OrthancPluginCompressPngImage(PyObject* module, PyObject* args) | |
898 { | |
899 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginCompressPngImage()"); | |
900 | |
901 long int arg0 = 0; | |
902 unsigned long arg1 = 0; | |
903 unsigned long arg2 = 0; | |
904 unsigned long arg3 = 0; | |
905 Py_buffer arg4; | |
906 | |
907 if (!PyArg_ParseTuple(args, "lkkks*", &arg0, &arg1, &arg2, &arg3, &arg4)) | |
908 { | |
909 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
910 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (5 arguments expected)"); | |
911 return NULL; | |
912 } | |
913 OrthancPlugins::MemoryBuffer buffer; | |
914 OrthancPluginErrorCode code = OrthancPluginCompressPngImage(OrthancPlugins::GetGlobalContext(), *buffer, static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2, arg3, arg4.buf); | |
915 PyBuffer_Release(&arg4); | |
916 if (code == OrthancPluginErrorCode_Success) | |
917 { | |
918 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); | |
919 } | |
920 else | |
921 { | |
922 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
923 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
924 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
925 return NULL; | |
926 } | |
927 } | |
928 | |
929 static PyObject* sdk_OrthancPluginCompressJpegImage(PyObject* module, PyObject* args) | |
930 { | |
931 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginCompressJpegImage()"); | |
932 | |
933 long int arg0 = 0; | |
934 unsigned long arg1 = 0; | |
935 unsigned long arg2 = 0; | |
936 unsigned long arg3 = 0; | |
937 Py_buffer arg4; | |
938 unsigned char arg5 = 0; | |
939 | |
940 if (!PyArg_ParseTuple(args, "lkkks*b", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5)) | |
941 { | |
942 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
943 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (6 arguments expected)"); | |
944 return NULL; | |
945 } | |
946 OrthancPlugins::MemoryBuffer buffer; | |
947 OrthancPluginErrorCode code = OrthancPluginCompressJpegImage(OrthancPlugins::GetGlobalContext(), *buffer, static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2, arg3, arg4.buf, arg5); | |
948 PyBuffer_Release(&arg4); | |
949 if (code == OrthancPluginErrorCode_Success) | |
950 { | |
951 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); | |
952 } | |
953 else | |
954 { | |
955 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
956 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
957 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
958 return NULL; | |
959 } | |
960 } | |
961 | |
962 static PyObject* sdk_OrthancPluginHttpGet(PyObject* module, PyObject* args) | |
963 { | |
964 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginHttpGet()"); | |
965 | |
966 const char* arg0 = NULL; | |
967 const char* arg1 = NULL; | |
968 const char* arg2 = NULL; | |
969 | |
970 if (!PyArg_ParseTuple(args, "sss", &arg0, &arg1, &arg2)) | |
971 { | |
972 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
973 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); | |
974 return NULL; | |
975 } | |
976 OrthancPlugins::MemoryBuffer buffer; | |
977 OrthancPluginErrorCode code = OrthancPluginHttpGet(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1, arg2); | |
978 | |
979 if (code == OrthancPluginErrorCode_Success) | |
980 { | |
981 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); | |
982 } | |
983 else | |
984 { | |
985 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
986 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
987 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
988 return NULL; | |
989 } | |
990 } | |
991 | |
992 static PyObject* sdk_OrthancPluginHttpPost(PyObject* module, PyObject* args) | |
993 { | |
994 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginHttpPost()"); | |
995 | |
996 const char* arg0 = NULL; | |
997 Py_buffer arg1; | |
998 const char* arg3 = NULL; | |
999 const char* arg4 = NULL; | |
1000 | |
1001 if (!PyArg_ParseTuple(args, "ss*ss", &arg0, &arg1, &arg3, &arg4)) | |
1002 { | |
1003 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1004 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)"); | |
1005 return NULL; | |
1006 } | |
1007 OrthancPlugins::MemoryBuffer buffer; | |
1008 OrthancPluginErrorCode code = OrthancPluginHttpPost(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1.buf, arg1.len, arg3, arg4); | |
1009 PyBuffer_Release(&arg1); | |
1010 if (code == OrthancPluginErrorCode_Success) | |
1011 { | |
1012 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); | |
1013 } | |
1014 else | |
1015 { | |
1016 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1017 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
1018 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
1019 return NULL; | |
1020 } | |
1021 } | |
1022 | |
1023 static PyObject* sdk_OrthancPluginHttpPut(PyObject* module, PyObject* args) | |
1024 { | |
1025 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginHttpPut()"); | |
1026 | |
1027 const char* arg0 = NULL; | |
1028 Py_buffer arg1; | |
1029 const char* arg3 = NULL; | |
1030 const char* arg4 = NULL; | |
1031 | |
1032 if (!PyArg_ParseTuple(args, "ss*ss", &arg0, &arg1, &arg3, &arg4)) | |
1033 { | |
1034 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1035 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)"); | |
1036 return NULL; | |
1037 } | |
1038 OrthancPlugins::MemoryBuffer buffer; | |
1039 OrthancPluginErrorCode code = OrthancPluginHttpPut(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1.buf, arg1.len, arg3, arg4); | |
1040 PyBuffer_Release(&arg1); | |
1041 if (code == OrthancPluginErrorCode_Success) | |
1042 { | |
1043 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); | |
1044 } | |
1045 else | |
1046 { | |
1047 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1048 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
1049 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
1050 return NULL; | |
1051 } | |
1052 } | |
1053 | |
1054 static PyObject* sdk_OrthancPluginHttpDelete(PyObject* module, PyObject* args) | |
1055 { | |
1056 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginHttpDelete()"); | |
1057 | |
1058 const char* arg0 = NULL; | |
1059 const char* arg1 = NULL; | |
1060 const char* arg2 = NULL; | |
1061 | |
1062 if (!PyArg_ParseTuple(args, "sss", &arg0, &arg1, &arg2)) | |
1063 { | |
1064 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1065 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); | |
1066 return NULL; | |
1067 } | |
1068 OrthancPluginErrorCode code = OrthancPluginHttpDelete(OrthancPlugins::GetGlobalContext(), arg0, arg1, arg2); | |
1069 | |
1070 | |
1071 if (code == OrthancPluginErrorCode_Success) | |
1072 { | |
1073 Py_INCREF(Py_None); | |
1074 return Py_None; | |
1075 } | |
1076 else | |
1077 { | |
1078 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1079 //PythonLock::RaiseException(module, code); | |
1080 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
1081 return NULL; | |
1082 } | |
1083 } | |
1084 | |
1085 static PyObject* sdk_OrthancPluginGetFontsCount(PyObject* module, PyObject* args) | |
1086 { | |
1087 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginGetFontsCount()"); | |
1088 | |
1089 | |
1090 long value = OrthancPluginGetFontsCount(OrthancPlugins::GetGlobalContext()); | |
1091 | |
1092 return PyLong_FromLong(value); | |
1093 } | |
1094 | |
1095 static PyObject* sdk_OrthancPluginGetFontName(PyObject* module, PyObject* args) | |
1096 { | |
1097 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginGetFontName()"); | |
1098 | |
1099 unsigned long arg0 = 0; | |
1100 | |
1101 if (!PyArg_ParseTuple(args, "k", &arg0)) | |
1102 { | |
1103 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1104 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
1105 return NULL; | |
1106 } | |
1107 const char* s = OrthancPluginGetFontName(OrthancPlugins::GetGlobalContext(), arg0); | |
1108 | |
1109 if (s == NULL) | |
1110 { | |
1111 Py_INCREF(Py_None); | |
1112 return Py_None; | |
1113 } | |
1114 else | |
1115 { | |
1116 return PyUnicode_FromString(s); | |
1117 } | |
1118 } | |
1119 | |
1120 static PyObject* sdk_OrthancPluginGetFontSize(PyObject* module, PyObject* args) | |
1121 { | |
1122 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginGetFontSize()"); | |
1123 | |
1124 unsigned long arg0 = 0; | |
1125 | |
1126 if (!PyArg_ParseTuple(args, "k", &arg0)) | |
1127 { | |
1128 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1129 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
1130 return NULL; | |
1131 } | |
1132 long value = OrthancPluginGetFontSize(OrthancPlugins::GetGlobalContext(), arg0); | |
1133 | |
1134 return PyLong_FromLong(value); | |
1135 } | |
1136 | |
1137 static PyObject* sdk_OrthancPluginRegisterErrorCode(PyObject* module, PyObject* args) | |
1138 { | |
1139 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginRegisterErrorCode()"); | |
1140 | |
1141 long int arg0 = 0; | |
1142 unsigned short arg1 = 0; | |
1143 const char* arg2 = NULL; | |
1144 | |
1145 if (!PyArg_ParseTuple(args, "lHs", &arg0, &arg1, &arg2)) | |
1146 { | |
1147 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1148 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); | |
1149 return NULL; | |
1150 } | |
1151 OrthancPluginErrorCode code = OrthancPluginRegisterErrorCode(OrthancPlugins::GetGlobalContext(), arg0, arg1, arg2); | |
1152 | |
1153 | |
1154 if (code == OrthancPluginErrorCode_Success) | |
1155 { | |
1156 Py_INCREF(Py_None); | |
1157 return Py_None; | |
1158 } | |
1159 else | |
1160 { | |
1161 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1162 //PythonLock::RaiseException(module, code); | |
1163 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
1164 return NULL; | |
1165 } | |
1166 } | |
1167 | |
1168 static PyObject* sdk_OrthancPluginRegisterDictionaryTag(PyObject* module, PyObject* args) | |
1169 { | |
1170 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginRegisterDictionaryTag()"); | |
1171 | |
1172 unsigned short arg0 = 0; | |
1173 unsigned short arg1 = 0; | |
1174 long int arg2 = 0; | |
1175 const char* arg3 = NULL; | |
1176 unsigned long arg4 = 0; | |
1177 unsigned long arg5 = 0; | |
1178 | |
1179 if (!PyArg_ParseTuple(args, "HHlskk", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5)) | |
1180 { | |
1181 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1182 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (6 arguments expected)"); | |
1183 return NULL; | |
1184 } | |
1185 OrthancPluginErrorCode code = OrthancPluginRegisterDictionaryTag(OrthancPlugins::GetGlobalContext(), arg0, arg1, static_cast<OrthancPluginValueRepresentation>(arg2), arg3, arg4, arg5); | |
1186 | |
1187 | |
1188 if (code == OrthancPluginErrorCode_Success) | |
1189 { | |
1190 Py_INCREF(Py_None); | |
1191 return Py_None; | |
1192 } | |
1193 else | |
1194 { | |
1195 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1196 //PythonLock::RaiseException(module, code); | |
1197 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
1198 return NULL; | |
1199 } | |
1200 } | |
1201 | |
1202 static PyObject* sdk_OrthancPluginRegisterPrivateDictionaryTag(PyObject* module, PyObject* args) | |
1203 { | |
1204 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginRegisterPrivateDictionaryTag()"); | |
1205 | |
1206 unsigned short arg0 = 0; | |
1207 unsigned short arg1 = 0; | |
1208 long int arg2 = 0; | |
1209 const char* arg3 = NULL; | |
1210 unsigned long arg4 = 0; | |
1211 unsigned long arg5 = 0; | |
1212 const char* arg6 = NULL; | |
1213 | |
1214 if (!PyArg_ParseTuple(args, "HHlskks", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6)) | |
1215 { | |
1216 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1217 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (7 arguments expected)"); | |
1218 return NULL; | |
1219 } | |
1220 OrthancPluginErrorCode code = OrthancPluginRegisterPrivateDictionaryTag(OrthancPlugins::GetGlobalContext(), arg0, arg1, static_cast<OrthancPluginValueRepresentation>(arg2), arg3, arg4, arg5, arg6); | |
1221 | |
1222 | |
1223 if (code == OrthancPluginErrorCode_Success) | |
1224 { | |
1225 Py_INCREF(Py_None); | |
1226 return Py_None; | |
1227 } | |
1228 else | |
1229 { | |
1230 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1231 //PythonLock::RaiseException(module, code); | |
1232 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
1233 return NULL; | |
1234 } | |
1235 } | |
1236 | |
1237 static PyObject* sdk_OrthancPluginDicomBufferToJson(PyObject* module, PyObject* args) | |
1238 { | |
1239 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginDicomBufferToJson()"); | |
1240 | |
1241 Py_buffer arg0; | |
1242 long int arg2 = 0; | |
1243 long int arg3 = 0; | |
1244 unsigned long arg4 = 0; | |
1245 | |
1246 if (!PyArg_ParseTuple(args, "s*llk", &arg0, &arg2, &arg3, &arg4)) | |
1247 { | |
1248 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1249 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)"); | |
1250 return NULL; | |
1251 } | |
1252 OrthancPlugins::OrthancString s; | |
1253 s.Assign(OrthancPluginDicomBufferToJson(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len, static_cast<OrthancPluginDicomToJsonFormat>(arg2), static_cast<OrthancPluginDicomToJsonFlags>(arg3), arg4)); | |
1254 PyBuffer_Release(&arg0); | |
1255 if (s.GetContent() == NULL) | |
1256 { | |
1257 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1258 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
1259 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
1260 return NULL; | |
1261 } | |
1262 else | |
1263 { | |
1264 return PyUnicode_FromString(s.GetContent()); | |
1265 } | |
1266 } | |
1267 | |
1268 static PyObject* sdk_OrthancPluginDicomInstanceToJson(PyObject* module, PyObject* args) | |
1269 { | |
1270 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginDicomInstanceToJson()"); | |
1271 | |
1272 const char* arg0 = NULL; | |
1273 long int arg1 = 0; | |
1274 long int arg2 = 0; | |
1275 unsigned long arg3 = 0; | |
1276 | |
1277 if (!PyArg_ParseTuple(args, "sllk", &arg0, &arg1, &arg2, &arg3)) | |
1278 { | |
1279 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1280 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)"); | |
1281 return NULL; | |
1282 } | |
1283 OrthancPlugins::OrthancString s; | |
1284 s.Assign(OrthancPluginDicomInstanceToJson(OrthancPlugins::GetGlobalContext(), arg0, static_cast<OrthancPluginDicomToJsonFormat>(arg1), static_cast<OrthancPluginDicomToJsonFlags>(arg2), arg3)); | |
1285 | |
1286 if (s.GetContent() == NULL) | |
1287 { | |
1288 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1289 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
1290 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
1291 return NULL; | |
1292 } | |
1293 else | |
1294 { | |
1295 return PyUnicode_FromString(s.GetContent()); | |
1296 } | |
1297 } | |
1298 | |
1299 static PyObject* sdk_OrthancPluginCreateImage(PyObject* module, PyObject* args) | |
1300 { | |
1301 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginCreateImage()"); | |
1302 | |
1303 long int arg0 = 0; | |
1304 unsigned long arg1 = 0; | |
1305 unsigned long arg2 = 0; | |
1306 | |
1307 if (!PyArg_ParseTuple(args, "lkk", &arg0, &arg1, &arg2)) | |
1308 { | |
1309 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1310 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); | |
1311 return NULL; | |
1312 } | |
1313 // This is the case of a constructor | |
1314 OrthancPluginImage* obj = OrthancPluginCreateImage(OrthancPlugins::GetGlobalContext(), static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2); | |
1315 | |
1316 if (obj == NULL) | |
1317 { | |
1318 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1319 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
1320 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
1321 return NULL; | |
1322 } | |
1323 else | |
1324 { | |
1325 PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */); | |
1326 PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginImage_Type, argList); | |
1327 Py_DECREF(argList); | |
1328 return python; | |
1329 } | |
1330 } | |
1331 | |
1332 static PyObject* sdk_OrthancPluginDecodeDicomImage(PyObject* module, PyObject* args) | |
1333 { | |
1334 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginDecodeDicomImage()"); | |
1335 | |
1336 Py_buffer arg0; | |
1337 unsigned long arg2 = 0; | |
1338 | |
1339 if (!PyArg_ParseTuple(args, "s*k", &arg0, &arg2)) | |
1340 { | |
1341 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1342 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); | |
1343 return NULL; | |
1344 } | |
1345 // This is the case of a constructor | |
1346 OrthancPluginImage* obj = OrthancPluginDecodeDicomImage(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len, arg2); | |
1347 PyBuffer_Release(&arg0); | |
1348 if (obj == NULL) | |
1349 { | |
1350 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1351 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
1352 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
1353 return NULL; | |
1354 } | |
1355 else | |
1356 { | |
1357 PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */); | |
1358 PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginImage_Type, argList); | |
1359 Py_DECREF(argList); | |
1360 return python; | |
1361 } | |
1362 } | |
1363 | |
1364 static PyObject* sdk_OrthancPluginComputeMd5(PyObject* module, PyObject* args) | |
1365 { | |
1366 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginComputeMd5()"); | |
1367 | |
1368 Py_buffer arg0; | |
1369 | |
1370 if (!PyArg_ParseTuple(args, "s*", &arg0)) | |
1371 { | |
1372 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1373 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
1374 return NULL; | |
1375 } | |
1376 OrthancPlugins::OrthancString s; | |
1377 s.Assign(OrthancPluginComputeMd5(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len)); | |
1378 PyBuffer_Release(&arg0); | |
1379 if (s.GetContent() == NULL) | |
1380 { | |
1381 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1382 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
1383 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
1384 return NULL; | |
1385 } | |
1386 else | |
1387 { | |
1388 return PyUnicode_FromString(s.GetContent()); | |
1389 } | |
1390 } | |
1391 | |
1392 static PyObject* sdk_OrthancPluginComputeSha1(PyObject* module, PyObject* args) | |
1393 { | |
1394 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginComputeSha1()"); | |
1395 | |
1396 Py_buffer arg0; | |
1397 | |
1398 if (!PyArg_ParseTuple(args, "s*", &arg0)) | |
1399 { | |
1400 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1401 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
1402 return NULL; | |
1403 } | |
1404 OrthancPlugins::OrthancString s; | |
1405 s.Assign(OrthancPluginComputeSha1(OrthancPlugins::GetGlobalContext(), arg0.buf, arg0.len)); | |
1406 PyBuffer_Release(&arg0); | |
1407 if (s.GetContent() == NULL) | |
1408 { | |
1409 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1410 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
1411 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
1412 return NULL; | |
1413 } | |
1414 else | |
1415 { | |
1416 return PyUnicode_FromString(s.GetContent()); | |
1417 } | |
1418 } | |
1419 | |
1420 static PyObject* sdk_OrthancPluginGenerateUuid(PyObject* module, PyObject* args) | |
1421 { | |
1422 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginGenerateUuid()"); | |
1423 | |
1424 | |
1425 OrthancPlugins::OrthancString s; | |
1426 s.Assign(OrthancPluginGenerateUuid(OrthancPlugins::GetGlobalContext())); | |
1427 | |
1428 if (s.GetContent() == NULL) | |
1429 { | |
1430 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1431 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
1432 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
1433 return NULL; | |
1434 } | |
1435 else | |
1436 { | |
1437 return PyUnicode_FromString(s.GetContent()); | |
1438 } | |
1439 } | |
1440 | |
1441 static PyObject* sdk_OrthancPluginGetPeers(PyObject* module, PyObject* args) | |
1442 { | |
1443 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginGetPeers()"); | |
1444 | |
1445 | |
1446 // This is the case of a constructor | |
1447 OrthancPluginPeers* obj = OrthancPluginGetPeers(OrthancPlugins::GetGlobalContext()); | |
1448 | |
1449 if (obj == NULL) | |
1450 { | |
1451 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1452 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
1453 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
1454 return NULL; | |
1455 } | |
1456 else | |
1457 { | |
1458 PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */); | |
1459 PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginPeers_Type, argList); | |
1460 Py_DECREF(argList); | |
1461 return python; | |
1462 } | |
1463 } | |
1464 | |
1465 static PyObject* sdk_OrthancPluginAutodetectMimeType(PyObject* module, PyObject* args) | |
1466 { | |
1467 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginAutodetectMimeType()"); | |
1468 | |
1469 const char* arg0 = NULL; | |
1470 | |
1471 if (!PyArg_ParseTuple(args, "s", &arg0)) | |
1472 { | |
1473 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1474 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
1475 return NULL; | |
1476 } | |
1477 const char* s = OrthancPluginAutodetectMimeType(OrthancPlugins::GetGlobalContext(), arg0); | |
1478 | |
1479 if (s == NULL) | |
1480 { | |
1481 Py_INCREF(Py_None); | |
1482 return Py_None; | |
1483 } | |
1484 else | |
1485 { | |
1486 return PyUnicode_FromString(s); | |
1487 } | |
1488 } | |
1489 | |
1490 static PyObject* sdk_OrthancPluginSetMetricsValue(PyObject* module, PyObject* args) | |
1491 { | |
1492 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginSetMetricsValue()"); | |
1493 | |
1494 const char* arg0 = NULL; | |
1495 float arg1 = 0; | |
1496 long int arg2 = 0; | |
1497 | |
1498 if (!PyArg_ParseTuple(args, "sfl", &arg0, &arg1, &arg2)) | |
1499 { | |
1500 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1501 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); | |
1502 return NULL; | |
1503 } | |
1504 OrthancPluginSetMetricsValue(OrthancPlugins::GetGlobalContext(), arg0, arg1, static_cast<OrthancPluginMetricsType>(arg2)); | |
1505 | |
1506 | |
1507 Py_INCREF(Py_None); | |
1508 return Py_None; | |
1509 } | |
1510 | |
1511 static PyObject* sdk_OrthancPluginGetTagName(PyObject* module, PyObject* args) | |
1512 { | |
1513 OrthancPlugins::LogInfo("Calling Python global function: OrthancPluginGetTagName()"); | |
1514 | |
1515 unsigned short arg0 = 0; | |
1516 unsigned short arg1 = 0; | |
1517 const char* arg2 = NULL; | |
1518 | |
1519 if (!PyArg_ParseTuple(args, "HHs", &arg0, &arg1, &arg2)) | |
1520 { | |
1521 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1522 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); | |
1523 return NULL; | |
1524 } | |
1525 OrthancPlugins::OrthancString s; | |
1526 s.Assign(OrthancPluginGetTagName(OrthancPlugins::GetGlobalContext(), arg0, arg1, arg2)); | |
1527 | |
1528 if (s.GetContent() == NULL) | |
1529 { | |
1530 // TODO => RAISE : https://stackoverflow.com/questions/60832317 | |
1531 //PythonLock::RaiseException(module, OrthancPluginErrorCode_InternalError); | |
1532 PyErr_SetString(PyExc_ValueError, "Internal error"); | |
1533 return NULL; | |
1534 } | |
1535 else | |
1536 { | |
1537 return PyUnicode_FromString(s.GetContent()); | |
1538 } | |
1539 } | |
1540 | |
1541 | |
1542 static PyMethodDef ORTHANC_SDK_FUNCTIONS[] = | |
1543 { | |
1544 { "CheckVersionAdvanced", sdk_OrthancPluginCheckVersionAdvanced, METH_VARARGS, | |
1545 "Generated from C function OrthancPluginCheckVersionAdvanced()" }, | |
1546 { "CheckVersion", sdk_OrthancPluginCheckVersion, METH_VARARGS, | |
1547 "Generated from C function OrthancPluginCheckVersion()" }, | |
1548 { "LogError", sdk_OrthancPluginLogError, METH_VARARGS, | |
1549 "Generated from C function OrthancPluginLogError()" }, | |
1550 { "LogWarning", sdk_OrthancPluginLogWarning, METH_VARARGS, | |
1551 "Generated from C function OrthancPluginLogWarning()" }, | |
1552 { "LogInfo", sdk_OrthancPluginLogInfo, METH_VARARGS, | |
1553 "Generated from C function OrthancPluginLogInfo()" }, | |
1554 { "GetDicomForInstance", sdk_OrthancPluginGetDicomForInstance, METH_VARARGS, | |
1555 "Generated from C function OrthancPluginGetDicomForInstance()" }, | |
1556 { "RestApiGet", sdk_OrthancPluginRestApiGet, METH_VARARGS, | |
1557 "Generated from C function OrthancPluginRestApiGet()" }, | |
1558 { "RestApiGetAfterPlugins", sdk_OrthancPluginRestApiGetAfterPlugins, METH_VARARGS, | |
1559 "Generated from C function OrthancPluginRestApiGetAfterPlugins()" }, | |
1560 { "RestApiPost", sdk_OrthancPluginRestApiPost, METH_VARARGS, | |
1561 "Generated from C function OrthancPluginRestApiPost()" }, | |
1562 { "RestApiPostAfterPlugins", sdk_OrthancPluginRestApiPostAfterPlugins, METH_VARARGS, | |
1563 "Generated from C function OrthancPluginRestApiPostAfterPlugins()" }, | |
1564 { "RestApiDelete", sdk_OrthancPluginRestApiDelete, METH_VARARGS, | |
1565 "Generated from C function OrthancPluginRestApiDelete()" }, | |
1566 { "RestApiDeleteAfterPlugins", sdk_OrthancPluginRestApiDeleteAfterPlugins, METH_VARARGS, | |
1567 "Generated from C function OrthancPluginRestApiDeleteAfterPlugins()" }, | |
1568 { "RestApiPut", sdk_OrthancPluginRestApiPut, METH_VARARGS, | |
1569 "Generated from C function OrthancPluginRestApiPut()" }, | |
1570 { "RestApiPutAfterPlugins", sdk_OrthancPluginRestApiPutAfterPlugins, METH_VARARGS, | |
1571 "Generated from C function OrthancPluginRestApiPutAfterPlugins()" }, | |
1572 { "LookupPatient", sdk_OrthancPluginLookupPatient, METH_VARARGS, | |
1573 "Generated from C function OrthancPluginLookupPatient()" }, | |
1574 { "LookupStudy", sdk_OrthancPluginLookupStudy, METH_VARARGS, | |
1575 "Generated from C function OrthancPluginLookupStudy()" }, | |
1576 { "LookupStudyWithAccessionNumber", sdk_OrthancPluginLookupStudyWithAccessionNumber, METH_VARARGS, | |
1577 "Generated from C function OrthancPluginLookupStudyWithAccessionNumber()" }, | |
1578 { "LookupSeries", sdk_OrthancPluginLookupSeries, METH_VARARGS, | |
1579 "Generated from C function OrthancPluginLookupSeries()" }, | |
1580 { "LookupInstance", sdk_OrthancPluginLookupInstance, METH_VARARGS, | |
1581 "Generated from C function OrthancPluginLookupInstance()" }, | |
1582 { "GetOrthancPath", sdk_OrthancPluginGetOrthancPath, METH_VARARGS, | |
1583 "Generated from C function OrthancPluginGetOrthancPath()" }, | |
1584 { "GetOrthancDirectory", sdk_OrthancPluginGetOrthancDirectory, METH_VARARGS, | |
1585 "Generated from C function OrthancPluginGetOrthancDirectory()" }, | |
1586 { "GetConfigurationPath", sdk_OrthancPluginGetConfigurationPath, METH_VARARGS, | |
1587 "Generated from C function OrthancPluginGetConfigurationPath()" }, | |
1588 { "SetRootUri", sdk_OrthancPluginSetRootUri, METH_VARARGS, | |
1589 "Generated from C function OrthancPluginSetRootUri()" }, | |
1590 { "SetDescription", sdk_OrthancPluginSetDescription, METH_VARARGS, | |
1591 "Generated from C function OrthancPluginSetDescription()" }, | |
1592 { "ExtendOrthancExplorer", sdk_OrthancPluginExtendOrthancExplorer, METH_VARARGS, | |
1593 "Generated from C function OrthancPluginExtendOrthancExplorer()" }, | |
1594 { "GetGlobalProperty", sdk_OrthancPluginGetGlobalProperty, METH_VARARGS, | |
1595 "Generated from C function OrthancPluginGetGlobalProperty()" }, | |
1596 { "SetGlobalProperty", sdk_OrthancPluginSetGlobalProperty, METH_VARARGS, | |
1597 "Generated from C function OrthancPluginSetGlobalProperty()" }, | |
1598 { "GetCommandLineArgumentsCount", sdk_OrthancPluginGetCommandLineArgumentsCount, METH_VARARGS, | |
1599 "Generated from C function OrthancPluginGetCommandLineArgumentsCount()" }, | |
1600 { "GetCommandLineArgument", sdk_OrthancPluginGetCommandLineArgument, METH_VARARGS, | |
1601 "Generated from C function OrthancPluginGetCommandLineArgument()" }, | |
1602 { "GetExpectedDatabaseVersion", sdk_OrthancPluginGetExpectedDatabaseVersion, METH_VARARGS, | |
1603 "Generated from C function OrthancPluginGetExpectedDatabaseVersion()" }, | |
1604 { "GetConfiguration", sdk_OrthancPluginGetConfiguration, METH_VARARGS, | |
1605 "Generated from C function OrthancPluginGetConfiguration()" }, | |
1606 { "BufferCompression", sdk_OrthancPluginBufferCompression, METH_VARARGS, | |
1607 "Generated from C function OrthancPluginBufferCompression()" }, | |
1608 { "ReadFile", sdk_OrthancPluginReadFile, METH_VARARGS, | |
1609 "Generated from C function OrthancPluginReadFile()" }, | |
1610 { "WriteFile", sdk_OrthancPluginWriteFile, METH_VARARGS, | |
1611 "Generated from C function OrthancPluginWriteFile()" }, | |
1612 { "GetErrorDescription", sdk_OrthancPluginGetErrorDescription, METH_VARARGS, | |
1613 "Generated from C function OrthancPluginGetErrorDescription()" }, | |
1614 { "UncompressImage", sdk_OrthancPluginUncompressImage, METH_VARARGS, | |
1615 "Generated from C function OrthancPluginUncompressImage()" }, | |
1616 { "CompressPngImage", sdk_OrthancPluginCompressPngImage, METH_VARARGS, | |
1617 "Generated from C function OrthancPluginCompressPngImage()" }, | |
1618 { "CompressJpegImage", sdk_OrthancPluginCompressJpegImage, METH_VARARGS, | |
1619 "Generated from C function OrthancPluginCompressJpegImage()" }, | |
1620 { "HttpGet", sdk_OrthancPluginHttpGet, METH_VARARGS, | |
1621 "Generated from C function OrthancPluginHttpGet()" }, | |
1622 { "HttpPost", sdk_OrthancPluginHttpPost, METH_VARARGS, | |
1623 "Generated from C function OrthancPluginHttpPost()" }, | |
1624 { "HttpPut", sdk_OrthancPluginHttpPut, METH_VARARGS, | |
1625 "Generated from C function OrthancPluginHttpPut()" }, | |
1626 { "HttpDelete", sdk_OrthancPluginHttpDelete, METH_VARARGS, | |
1627 "Generated from C function OrthancPluginHttpDelete()" }, | |
1628 { "GetFontsCount", sdk_OrthancPluginGetFontsCount, METH_VARARGS, | |
1629 "Generated from C function OrthancPluginGetFontsCount()" }, | |
1630 { "GetFontName", sdk_OrthancPluginGetFontName, METH_VARARGS, | |
1631 "Generated from C function OrthancPluginGetFontName()" }, | |
1632 { "GetFontSize", sdk_OrthancPluginGetFontSize, METH_VARARGS, | |
1633 "Generated from C function OrthancPluginGetFontSize()" }, | |
1634 { "RegisterErrorCode", sdk_OrthancPluginRegisterErrorCode, METH_VARARGS, | |
1635 "Generated from C function OrthancPluginRegisterErrorCode()" }, | |
1636 { "RegisterDictionaryTag", sdk_OrthancPluginRegisterDictionaryTag, METH_VARARGS, | |
1637 "Generated from C function OrthancPluginRegisterDictionaryTag()" }, | |
1638 { "RegisterPrivateDictionaryTag", sdk_OrthancPluginRegisterPrivateDictionaryTag, METH_VARARGS, | |
1639 "Generated from C function OrthancPluginRegisterPrivateDictionaryTag()" }, | |
1640 { "DicomBufferToJson", sdk_OrthancPluginDicomBufferToJson, METH_VARARGS, | |
1641 "Generated from C function OrthancPluginDicomBufferToJson()" }, | |
1642 { "DicomInstanceToJson", sdk_OrthancPluginDicomInstanceToJson, METH_VARARGS, | |
1643 "Generated from C function OrthancPluginDicomInstanceToJson()" }, | |
1644 { "CreateImage", sdk_OrthancPluginCreateImage, METH_VARARGS, | |
1645 "Generated from C function OrthancPluginCreateImage()" }, | |
1646 { "DecodeDicomImage", sdk_OrthancPluginDecodeDicomImage, METH_VARARGS, | |
1647 "Generated from C function OrthancPluginDecodeDicomImage()" }, | |
1648 { "ComputeMd5", sdk_OrthancPluginComputeMd5, METH_VARARGS, | |
1649 "Generated from C function OrthancPluginComputeMd5()" }, | |
1650 { "ComputeSha1", sdk_OrthancPluginComputeSha1, METH_VARARGS, | |
1651 "Generated from C function OrthancPluginComputeSha1()" }, | |
1652 { "GenerateUuid", sdk_OrthancPluginGenerateUuid, METH_VARARGS, | |
1653 "Generated from C function OrthancPluginGenerateUuid()" }, | |
1654 { "GetPeers", sdk_OrthancPluginGetPeers, METH_VARARGS, | |
1655 "Generated from C function OrthancPluginGetPeers()" }, | |
1656 { "AutodetectMimeType", sdk_OrthancPluginAutodetectMimeType, METH_VARARGS, | |
1657 "Generated from C function OrthancPluginAutodetectMimeType()" }, | |
1658 { "SetMetricsValue", sdk_OrthancPluginSetMetricsValue, METH_VARARGS, | |
1659 "Generated from C function OrthancPluginSetMetricsValue()" }, | |
1660 { "GetTagName", sdk_OrthancPluginGetTagName, METH_VARARGS, | |
1661 "Generated from C function OrthancPluginGetTagName()" }, | |
1662 { NULL, NULL } | |
1663 }; | |
1664 | |
1665 | |
1666 PyMethodDef* GetOrthancSdkFunctions() | |
1667 { | |
1668 return ORTHANC_SDK_FUNCTIONS; | |
1669 } |