comparison Sources/Autogenerated/sdk_OrthancPluginDicomInstance.methods.h @ 184:f34f3a149c22 java-code-model

added class PythonThreadsAllower
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 02 Jul 2024 15:49:05 +0200
parents e9be3c9294d4
children 55473de7694f
comparison
equal deleted inserted replaced
183:d31f216c9462 184:f34f3a149c22
10 return NULL; 10 return NULL;
11 } 11 }
12 12
13 13
14 14
15 const char* s = OrthancPluginGetInstanceRemoteAet(OrthancPlugins::GetGlobalContext(), self->object_); 15 const char* s;
16 {
17 PythonThreadsAllower allower;
18 s = OrthancPluginGetInstanceRemoteAet(OrthancPlugins::GetGlobalContext(), self->object_);
19 }
16 20
17 if (s == NULL) 21 if (s == NULL)
18 { 22 {
19 Py_INCREF(Py_None); 23 Py_INCREF(Py_None);
20 return Py_None; 24 return Py_None;
36 return NULL; 40 return NULL;
37 } 41 }
38 42
39 43
40 44
41 long value = OrthancPluginGetInstanceSize(OrthancPlugins::GetGlobalContext(), self->object_); 45 long value;
46 {
47 PythonThreadsAllower allower;
48 value = OrthancPluginGetInstanceSize(OrthancPlugins::GetGlobalContext(), self->object_);
49 }
42 50
43 return PyLong_FromLong(value); 51 return PyLong_FromLong(value);
44 } 52 }
45 53
46 static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceJson( 54 static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceJson(
55 } 63 }
56 64
57 65
58 66
59 OrthancPlugins::OrthancString s; 67 OrthancPlugins::OrthancString s;
60 s.Assign(OrthancPluginGetInstanceJson(OrthancPlugins::GetGlobalContext(), self->object_)); 68 {
69 PythonThreadsAllower allower;
70 s.Assign(OrthancPluginGetInstanceJson(OrthancPlugins::GetGlobalContext(), self->object_));
71 }
61 72
62 if (s.GetContent() == NULL) 73 if (s.GetContent() == NULL)
63 { 74 {
64 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); 75 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
65 return NULL; 76 return NULL;
82 } 93 }
83 94
84 95
85 96
86 OrthancPlugins::OrthancString s; 97 OrthancPlugins::OrthancString s;
87 s.Assign(OrthancPluginGetInstanceSimplifiedJson(OrthancPlugins::GetGlobalContext(), self->object_)); 98 {
99 PythonThreadsAllower allower;
100 s.Assign(OrthancPluginGetInstanceSimplifiedJson(OrthancPlugins::GetGlobalContext(), self->object_));
101 }
88 102
89 if (s.GetContent() == NULL) 103 if (s.GetContent() == NULL)
90 { 104 {
91 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); 105 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
92 return NULL; 106 return NULL;
114 { 128 {
115 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 129 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
116 return NULL; 130 return NULL;
117 } 131 }
118 132
119 long value = OrthancPluginHasInstanceMetadata(OrthancPlugins::GetGlobalContext(), self->object_, arg0); 133 long value;
134 {
135 PythonThreadsAllower allower;
136 value = OrthancPluginHasInstanceMetadata(OrthancPlugins::GetGlobalContext(), self->object_, arg0);
137 }
120 138
121 return PyLong_FromLong(value); 139 return PyLong_FromLong(value);
122 } 140 }
123 141
124 static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceMetadata( 142 static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceMetadata(
138 { 156 {
139 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 157 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
140 return NULL; 158 return NULL;
141 } 159 }
142 160
143 const char* s = OrthancPluginGetInstanceMetadata(OrthancPlugins::GetGlobalContext(), self->object_, arg0); 161 const char* s;
162 {
163 PythonThreadsAllower allower;
164 s = OrthancPluginGetInstanceMetadata(OrthancPlugins::GetGlobalContext(), self->object_, arg0);
165 }
144 166
145 if (s == NULL) 167 if (s == NULL)
146 { 168 {
147 Py_INCREF(Py_None); 169 Py_INCREF(Py_None);
148 return Py_None; 170 return Py_None;
164 return NULL; 186 return NULL;
165 } 187 }
166 188
167 189
168 190
169 OrthancPluginInstanceOrigin value = OrthancPluginGetInstanceOrigin(OrthancPlugins::GetGlobalContext(), self->object_); 191 OrthancPluginInstanceOrigin value;
192 {
193 PythonThreadsAllower allower;
194 value = OrthancPluginGetInstanceOrigin(OrthancPlugins::GetGlobalContext(), self->object_);
195 }
170 196
171 return PyLong_FromLong(value); 197 return PyLong_FromLong(value);
172 } 198 }
173 199
174 static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceTransferSyntaxUid( 200 static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceTransferSyntaxUid(
183 } 209 }
184 210
185 211
186 212
187 OrthancPlugins::OrthancString s; 213 OrthancPlugins::OrthancString s;
188 s.Assign(OrthancPluginGetInstanceTransferSyntaxUid(OrthancPlugins::GetGlobalContext(), self->object_)); 214 {
215 PythonThreadsAllower allower;
216 s.Assign(OrthancPluginGetInstanceTransferSyntaxUid(OrthancPlugins::GetGlobalContext(), self->object_));
217 }
189 218
190 if (s.GetContent() == NULL) 219 if (s.GetContent() == NULL)
191 { 220 {
192 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); 221 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
193 return NULL; 222 return NULL;
209 return NULL; 238 return NULL;
210 } 239 }
211 240
212 241
213 242
214 long value = OrthancPluginHasInstancePixelData(OrthancPlugins::GetGlobalContext(), self->object_); 243 long value;
244 {
245 PythonThreadsAllower allower;
246 value = OrthancPluginHasInstancePixelData(OrthancPlugins::GetGlobalContext(), self->object_);
247 }
215 248
216 return PyLong_FromLong(value); 249 return PyLong_FromLong(value);
217 } 250 }
218 251
219 static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceFramesCount( 252 static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceFramesCount(
227 return NULL; 260 return NULL;
228 } 261 }
229 262
230 263
231 264
232 long value = OrthancPluginGetInstanceFramesCount(OrthancPlugins::GetGlobalContext(), self->object_); 265 long value;
266 {
267 PythonThreadsAllower allower;
268 value = OrthancPluginGetInstanceFramesCount(OrthancPlugins::GetGlobalContext(), self->object_);
269 }
233 270
234 return PyLong_FromLong(value); 271 return PyLong_FromLong(value);
235 } 272 }
236 273
237 static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceRawFrame( 274 static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceRawFrame(
252 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 289 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
253 return NULL; 290 return NULL;
254 } 291 }
255 292
256 OrthancPlugins::MemoryBuffer buffer; 293 OrthancPlugins::MemoryBuffer buffer;
257 OrthancPluginErrorCode code = OrthancPluginGetInstanceRawFrame(OrthancPlugins::GetGlobalContext(), *buffer, self->object_, arg0); 294 OrthancPluginErrorCode code;
295 {
296 PythonThreadsAllower allower;
297 code = OrthancPluginGetInstanceRawFrame(OrthancPlugins::GetGlobalContext(), *buffer, self->object_, arg0);
298 }
258 299
259 if (code == OrthancPluginErrorCode_Success) 300 if (code == OrthancPluginErrorCode_Success)
260 { 301 {
261 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); 302 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize());
262 } 303 }
285 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); 326 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
286 return NULL; 327 return NULL;
287 } 328 }
288 329
289 // This is the case of a constructor 330 // This is the case of a constructor
290 OrthancPluginImage* obj = OrthancPluginGetInstanceDecodedFrame(OrthancPlugins::GetGlobalContext(), self->object_, arg0); 331 OrthancPluginImage* obj;
332 {
333 PythonThreadsAllower allower;
334 obj = OrthancPluginGetInstanceDecodedFrame(OrthancPlugins::GetGlobalContext(), self->object_, arg0);
335 }
291 336
292 if (obj == NULL) 337 if (obj == NULL)
293 { 338 {
294 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); 339 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
295 return NULL; 340 return NULL;
315 } 360 }
316 361
317 362
318 363
319 OrthancPlugins::MemoryBuffer buffer; 364 OrthancPlugins::MemoryBuffer buffer;
320 OrthancPluginErrorCode code = OrthancPluginSerializeDicomInstance(OrthancPlugins::GetGlobalContext(), *buffer, self->object_); 365 OrthancPluginErrorCode code;
366 {
367 PythonThreadsAllower allower;
368 code = OrthancPluginSerializeDicomInstance(OrthancPlugins::GetGlobalContext(), *buffer, self->object_);
369 }
321 370
322 if (code == OrthancPluginErrorCode_Success) 371 if (code == OrthancPluginErrorCode_Success)
323 { 372 {
324 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize()); 373 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize());
325 } 374 }
350 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); 399 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)");
351 return NULL; 400 return NULL;
352 } 401 }
353 402
354 OrthancPlugins::OrthancString s; 403 OrthancPlugins::OrthancString s;
355 s.Assign(OrthancPluginGetInstanceAdvancedJson(OrthancPlugins::GetGlobalContext(), self->object_, static_cast<OrthancPluginDicomToJsonFormat>(arg0), static_cast<OrthancPluginDicomToJsonFlags>(arg1), arg2)); 404 {
405 PythonThreadsAllower allower;
406 s.Assign(OrthancPluginGetInstanceAdvancedJson(OrthancPlugins::GetGlobalContext(), self->object_, static_cast<OrthancPluginDicomToJsonFormat>(arg0), static_cast<OrthancPluginDicomToJsonFlags>(arg1), arg2));
407 }
356 408
357 if (s.GetContent() == NULL) 409 if (s.GetContent() == NULL)
358 { 410 {
359 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); 411 PythonLock::RaiseException(OrthancPluginErrorCode_InternalError);
360 return NULL; 412 return NULL;