annotate Sources/DicomScpCallbacks.cpp @ 131:c55b0583084b

integration fix-leak->mainline
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 30 Aug 2023 11:52:45 +0200
parents a3f77cf16396 a862d554753f
children 566df919b286 71d305c29cfa
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
63
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Python plugin for Orthanc
114
65ec5597ec70 upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 101
diff changeset
3 * Copyright (C) 2020-2023 Osimis S.A., Belgium
65ec5597ec70 upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 101
diff changeset
4 * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
63
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 *
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 * This program is free software: you can redistribute it and/or
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * modify it under the terms of the GNU Affero General Public License
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * as published by the Free Software Foundation, either version 3 of
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * the License, or (at your option) any later version.
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 *
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful, but
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * Affero General Public License for more details.
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 *
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * You should have received a copy of the GNU Affero General Public License
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 **/
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 #include "DicomScpCallbacks.h"
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 #include "../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h"
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #include "Autogenerated/sdk.h"
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 #include "ICallbackRegistration.h"
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 #include "PythonString.h"
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 static PyObject* findScpCallback_ = NULL;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 static PyObject* moveScpCallback_ = NULL;
64
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
31 static PyObject* worklistScpCallback_ = NULL;
63
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 static PyObject *GetFindQueryTag(sdk_OrthancPluginFindQuery_Object* self,
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 PyObject *args,
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 bool isGroup)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 unsigned long index;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 uint16_t group, element;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 if (self->object_ == NULL)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 PyErr_SetString(PyExc_ValueError, "Invalid object");
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 return NULL;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 else if (!PyArg_ParseTuple(args, "k", &index))
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 PyErr_SetString(PyExc_TypeError, "Index is missing");
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 return NULL;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 else if (OrthancPluginGetFindQueryTag(OrthancPlugins::GetGlobalContext(), &group, &element, self->object_, index) !=
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 OrthancPluginErrorCode_Success)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 PyErr_SetString(PyExc_ValueError, "Index is out of range");
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 return NULL;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 else if (isGroup)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 return PyLong_FromUnsignedLong(group);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 else
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 return PyLong_FromUnsignedLong(element);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 // Check out "CUSTOM_METHODS" in "../CodeAnalysis/ParseOrthancSDK.py"
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 PyObject *GetFindQueryTagGroup(sdk_OrthancPluginFindQuery_Object* self, PyObject *args)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 return GetFindQueryTag(self, args, true);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 PyObject *GetFindQueryTagElement(sdk_OrthancPluginFindQuery_Object* self, PyObject *args)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 return GetFindQueryTag(self, args, false);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79
64
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
80 PyObject *WorklistAddAnswer(sdk_OrthancPluginWorklistAnswers_Object* self, PyObject *args)
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
81 {
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
82 PyObject* query = NULL;
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
83 Py_buffer dicom;
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
84
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
85 if (self->object_ == NULL)
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
86 {
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
87 PyErr_SetString(PyExc_ValueError, "Invalid object");
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
88 return NULL;
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
89 }
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
90 else if (!PyArg_ParseTuple(args, "Os*", &query, &dicom))
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
91 {
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
92 PyErr_SetString(PyExc_TypeError, "Please provide a orthanc.WorklistQuery object, and a DICOM buffer");
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
93 return NULL;
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
94 }
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
95 else if (query == Py_None ||
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
96 Py_TYPE(query) != GetOrthancPluginWorklistQueryType())
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
97 {
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
98 PyErr_SetString(PyExc_TypeError, "Invalid orthanc.WorklistQuery object");
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
99 return NULL;
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
100 }
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
101 else
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
102 {
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
103 OrthancPluginErrorCode code = OrthancPluginWorklistAddAnswer(
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
104 OrthancPlugins::GetGlobalContext(), self->object_,
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
105 reinterpret_cast<sdk_OrthancPluginWorklistQuery_Object*>(query)->object_,
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
106 dicom.buf, dicom.len);
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
107
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
108 PyBuffer_Release(&dicom);
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
109
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
110 if (code == OrthancPluginErrorCode_Success)
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
111 {
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
112 Py_INCREF(Py_None);
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
113 return Py_None;
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
114 }
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
115 else
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
116 {
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
117 PyErr_SetString(PyExc_ValueError, "Internal error");
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
118 return NULL;
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
119 }
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
120 }
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
121 }
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
122 // End of "CUSTOM_METHODS"
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
123
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
124
63
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 static OrthancPluginErrorCode FindCallback(OrthancPluginFindAnswers *answers,
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 const OrthancPluginFindQuery *query,
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 const char *issuerAet,
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 const char *calledAet)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 try
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 PythonLock lock;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 PyObject *pAnswers, *pQuery;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 PythonObject args(lock, PyTuple_New(2));
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 PyTuple_SetItem(args.GetPyObject(), 0, PyLong_FromSsize_t((intptr_t) answers));
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140 PyTuple_SetItem(args.GetPyObject(), 1, PyBool_FromLong(true /* borrowed, don't destruct */));
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
141 pAnswers = PyObject_CallObject((PyObject *) GetOrthancPluginFindAnswersType(), args.GetPyObject());
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
142 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
143
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
144 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
145 PythonObject args(lock, PyTuple_New(2));
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 PyTuple_SetItem(args.GetPyObject(), 0, PyLong_FromSsize_t((intptr_t) query));
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 PyTuple_SetItem(args.GetPyObject(), 1, PyBool_FromLong(true /* borrowed, don't destruct */));
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 pQuery = PyObject_CallObject((PyObject *) GetOrthancPluginFindQueryType(), args.GetPyObject());
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 PythonString pIssuerAet(lock, issuerAet);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 PythonString pCalledAet(lock, calledAet);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
154 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 PythonObject args(lock, PyTuple_New(4));
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 PyTuple_SetItem(args.GetPyObject(), 0, pAnswers);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 PyTuple_SetItem(args.GetPyObject(), 1, pQuery);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158 PyTuple_SetItem(args.GetPyObject(), 2, pIssuerAet.Release());
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 PyTuple_SetItem(args.GetPyObject(), 3, pCalledAet.Release());
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 assert(findScpCallback_ != NULL);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 PythonObject result(lock, PyObject_CallObject(findScpCallback_, args.GetPyObject()));
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 return lock.CheckCallbackSuccess("Python C-FIND SCP callback");
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 catch (OrthancPlugins::PluginException& e)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 return e.GetErrorCode();
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 class IMoveDriver : public boost::noncopyable
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177 public:
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178 virtual ~IMoveDriver()
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
179 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
180 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182 virtual void Apply() = 0;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183 };
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
185
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186 static void* CreateMoveCallback(OrthancPluginResourceType resourceType,
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 const char *patientId,
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188 const char *accessionNumber,
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189 const char *studyInstanceUid,
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190 const char *seriesInstanceUid,
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191 const char *sopInstanceUid,
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 const char *originatorAet,
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 const char *sourceAet,
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194 const char *targetAet,
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195 uint16_t originatorId)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197 class Driver : public IMoveDriver
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 private:
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 OrthancPluginResourceType resourceType_;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201 std::string patientId_;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202 std::string accessionNumber_;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 std::string studyInstanceUid_;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 std::string seriesInstanceUid_;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205 std::string sopInstanceUid_;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206 std::string originatorAet_;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207 std::string sourceAet_;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208 std::string targetAet_;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209 uint16_t originatorId_;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211 public:
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212 Driver(OrthancPluginResourceType resourceType,
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213 const char *patientId,
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214 const char *accessionNumber,
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215 const char *studyInstanceUid,
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216 const char *seriesInstanceUid,
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 const char *sopInstanceUid,
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218 const char *originatorAet,
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219 const char *sourceAet,
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220 const char *targetAet,
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 uint16_t originatorId) :
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222 resourceType_(resourceType),
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223 originatorId_(originatorId)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225 if (patientId != NULL)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
227 patientId_.assign(patientId);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
230 if (accessionNumber != NULL)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
231 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
232 accessionNumber_.assign(accessionNumber);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
233 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
234
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
235 if (studyInstanceUid != NULL)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
236 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
237 studyInstanceUid_.assign(studyInstanceUid);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
238 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
239
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
240 if (seriesInstanceUid != NULL)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
241 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
242 seriesInstanceUid_.assign(seriesInstanceUid);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
243 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
244
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
245 if (sopInstanceUid != NULL)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
246 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
247 sopInstanceUid_.assign(sopInstanceUid);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
248 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
249
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
250 if (originatorAet != NULL)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
251 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
252 originatorAet_.assign(originatorAet);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
253 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
254
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
255 if (sourceAet != NULL)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
256 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
257 sourceAet_.assign(sourceAet);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
258 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
259
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
260 if (targetAet != NULL)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
261 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
262 targetAet_.assign(targetAet);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
263 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
264 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
265
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
266
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
267 virtual void Apply() ORTHANC_OVERRIDE
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
268 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
269 PythonLock lock;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
270
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
271 PythonObject kw(lock, PyDict_New());
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
272
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
273 std::string level;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
274 switch (resourceType_)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
275 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
276 case OrthancPluginResourceType_Patient:
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
277 level = "PATIENT";
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
278 break;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
279
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
280 case OrthancPluginResourceType_Study:
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
281 level = "STUDY";
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
282 break;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
283
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
284 case OrthancPluginResourceType_Series:
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
285 level = "SERIES";
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
286 break;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
287
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
288 case OrthancPluginResourceType_Instance:
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
289 level = "INSTANCE";
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
290 break;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
291
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
292 default:
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
293 throw OrthancPlugins::PluginException(OrthancPluginErrorCode_ParameterOutOfRange);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
294 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
295
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
296 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
297 PythonString tmp(lock, level);
126
9ffe8881f856 fixing more PyDict_SetItemString()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 101
diff changeset
298 PyDict_SetItemString(kw.GetPyObject(), "Level", tmp.GetPyObject());
63
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
299 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
300
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
301 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
302 PythonString tmp(lock, patientId_);
126
9ffe8881f856 fixing more PyDict_SetItemString()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 101
diff changeset
303 PyDict_SetItemString(kw.GetPyObject(), "PatientID", tmp.GetPyObject());
63
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
304 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
305
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
306 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
307 PythonString tmp(lock, accessionNumber_);
126
9ffe8881f856 fixing more PyDict_SetItemString()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 101
diff changeset
308 PyDict_SetItemString(kw.GetPyObject(), "AccessionNumber", tmp.GetPyObject());
63
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
309 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
310
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
311 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
312 PythonString tmp(lock, studyInstanceUid_);
126
9ffe8881f856 fixing more PyDict_SetItemString()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 101
diff changeset
313 PyDict_SetItemString(kw.GetPyObject(), "StudyInstanceUID", tmp.GetPyObject());
63
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
314 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
315
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
316 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
317 PythonString tmp(lock, seriesInstanceUid_);
126
9ffe8881f856 fixing more PyDict_SetItemString()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 101
diff changeset
318 PyDict_SetItemString(kw.GetPyObject(), "SeriesInstanceUID", tmp.GetPyObject());
63
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
319 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
320
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
321 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
322 PythonString tmp(lock, sopInstanceUid_);
126
9ffe8881f856 fixing more PyDict_SetItemString()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 101
diff changeset
323 PyDict_SetItemString(kw.GetPyObject(), "SOPInstanceUID", tmp.GetPyObject());
63
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
324 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
325
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
326 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
327 PythonString tmp(lock, originatorAet_);
126
9ffe8881f856 fixing more PyDict_SetItemString()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 101
diff changeset
328 PyDict_SetItemString(kw.GetPyObject(), "OriginatorAET", tmp.GetPyObject());
63
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
329 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
330
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
331 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
332 PythonString tmp(lock, sourceAet_);
126
9ffe8881f856 fixing more PyDict_SetItemString()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 101
diff changeset
333 PyDict_SetItemString(kw.GetPyObject(), "SourceAET", tmp.GetPyObject());
63
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
334 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
335
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
336 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
337 PythonString tmp(lock, targetAet_);
126
9ffe8881f856 fixing more PyDict_SetItemString()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 101
diff changeset
338 PyDict_SetItemString(kw.GetPyObject(), "TargetAET", tmp.GetPyObject());
63
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
339 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
340
127
a862d554753f fixing leaks associated with setting integers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 126
diff changeset
341 {
a862d554753f fixing leaks associated with setting integers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 126
diff changeset
342 PythonObject tmp(lock, PyLong_FromUnsignedLong(originatorId_));
a862d554753f fixing leaks associated with setting integers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 126
diff changeset
343 PyDict_SetItemString(kw.GetPyObject(), "OriginatorID", tmp.GetPyObject());
a862d554753f fixing leaks associated with setting integers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 126
diff changeset
344 }
63
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
345
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
346 PythonObject args(lock, PyTuple_New(0));
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
347
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
348 assert(moveScpCallback_ != NULL);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
349 PythonObject result(lock, PyObject_Call(moveScpCallback_, args.GetPyObject(), kw.GetPyObject()));
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
350
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
351 OrthancPluginErrorCode code = lock.CheckCallbackSuccess("Python C-MOVE SCP callback");
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
352 if (code != OrthancPluginErrorCode_Success)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
353 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
354 throw OrthancPlugins::PluginException(code);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
355 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
356 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
357 };
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
358
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
359 try
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
360 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
361 return new Driver(resourceType, patientId, accessionNumber, studyInstanceUid,
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
362 seriesInstanceUid, sopInstanceUid, originatorAet, sourceAet,
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
363 targetAet, originatorId);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
364 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
365 catch (OrthancPlugins::PluginException& e)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
366 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
367 return NULL;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
368 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
369 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
370
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
371
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
372 static uint32_t GetMoveSize(void *moveDriver)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
373 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
374 assert(moveDriver != NULL);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
375 return 1;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
376 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
377
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
378
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
379 OrthancPluginErrorCode ApplyMove(void *moveDriver)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
380 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
381 assert(moveDriver != NULL);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
382
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
383 try
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
384 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
385 reinterpret_cast<IMoveDriver*>(moveDriver)->Apply();
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
386 return OrthancPluginErrorCode_Success;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
387 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
388 catch (OrthancPlugins::PluginException& e)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
389 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
390 return e.GetErrorCode();
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
391 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
392 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
393
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
394
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
395 void FreeMove(void *moveDriver)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
396 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
397 assert(moveDriver != NULL);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
398 delete reinterpret_cast<IMoveDriver*>(moveDriver);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
399 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
400
64
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
401
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
402
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
403 OrthancPluginErrorCode WorklistCallback(OrthancPluginWorklistAnswers *answers,
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
404 const OrthancPluginWorklistQuery *query,
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
405 const char *issuerAet,
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
406 const char *calledAet)
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
407 {
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
408 try
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
409 {
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
410 PythonLock lock;
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
411
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
412 PyObject *pAnswers, *pQuery;
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
413
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
414 {
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
415 PythonObject args(lock, PyTuple_New(2));
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
416 PyTuple_SetItem(args.GetPyObject(), 0, PyLong_FromSsize_t((intptr_t) answers));
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
417 PyTuple_SetItem(args.GetPyObject(), 1, PyBool_FromLong(true /* borrowed, don't destruct */));
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
418 pAnswers = PyObject_CallObject((PyObject *) GetOrthancPluginWorklistAnswersType(), args.GetPyObject());
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
419 }
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
420
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
421 {
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
422 PythonObject args(lock, PyTuple_New(2));
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
423 PyTuple_SetItem(args.GetPyObject(), 0, PyLong_FromSsize_t((intptr_t) query));
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
424 PyTuple_SetItem(args.GetPyObject(), 1, PyBool_FromLong(true /* borrowed, don't destruct */));
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
425 pQuery = PyObject_CallObject((PyObject *) GetOrthancPluginWorklistQueryType(), args.GetPyObject());
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
426 }
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
427
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
428 PythonString pIssuerAet(lock, issuerAet);
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
429 PythonString pCalledAet(lock, calledAet);
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
430
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
431 {
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
432 PythonObject args(lock, PyTuple_New(4));
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
433 PyTuple_SetItem(args.GetPyObject(), 0, pAnswers);
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
434 PyTuple_SetItem(args.GetPyObject(), 1, pQuery);
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
435 PyTuple_SetItem(args.GetPyObject(), 2, pIssuerAet.Release());
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
436 PyTuple_SetItem(args.GetPyObject(), 3, pCalledAet.Release());
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
437
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
438 assert(worklistScpCallback_ != NULL);
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
439 PythonObject result(lock, PyObject_CallObject(worklistScpCallback_, args.GetPyObject()));
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
440 }
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
441
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
442 return lock.CheckCallbackSuccess("Python C-FIND SCP for worklist callback");
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
443 }
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
444 catch (OrthancPlugins::PluginException& e)
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
445 {
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
446 return e.GetErrorCode();
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
447 }
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
448 }
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
449
63
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
450
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
451 PyObject* RegisterFindCallback(PyObject* module, PyObject* args)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
452 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
453 // The GIL is locked at this point (no need to create "PythonLock")
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
454
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
455 class Registration : public ICallbackRegistration
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
456 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
457 public:
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
458 virtual void Register() ORTHANC_OVERRIDE
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
459 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
460 OrthancPluginRegisterFindCallback(OrthancPlugins::GetGlobalContext(), FindCallback);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
461 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
462 };
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
463
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
464 Registration registration;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
465 return ICallbackRegistration::Apply(
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
466 registration, args, findScpCallback_, "Python C-FIND SCP callback");
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
467 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
468
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
469
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
470 PyObject* RegisterMoveCallback(PyObject* module, PyObject* args)
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
471 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
472 // The GIL is locked at this point (no need to create "PythonLock")
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
473
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
474 class Registration : public ICallbackRegistration
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
475 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
476 public:
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
477 virtual void Register() ORTHANC_OVERRIDE
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
478 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
479 OrthancPluginRegisterMoveCallback(
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
480 OrthancPlugins::GetGlobalContext(), CreateMoveCallback, GetMoveSize, ApplyMove, FreeMove);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
481 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
482 };
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
483
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
484 Registration registration;
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
485 return ICallbackRegistration::Apply(
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
486 registration, args, moveScpCallback_, "Python C-MOVE SCP callback");
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
487 }
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
488
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
489
64
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
490 PyObject* RegisterWorklistCallback(PyObject* module, PyObject* args)
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
491 {
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
492 // The GIL is locked at this point (no need to create "PythonLock")
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
493
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
494 class Registration : public ICallbackRegistration
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
495 {
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
496 public:
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
497 virtual void Register() ORTHANC_OVERRIDE
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
498 {
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
499 OrthancPluginRegisterWorklistCallback(OrthancPlugins::GetGlobalContext(), WorklistCallback);
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
500 }
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
501 };
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
502
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
503 Registration registration;
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
504 return ICallbackRegistration::Apply(
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
505 registration, args, worklistScpCallback_, "Python C-FIND SCP for worklist callback");
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
506 }
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
507
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
508
63
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
509 void FinalizeDicomScpCallbacks()
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
510 {
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
511 ICallbackRegistration::Unregister(findScpCallback_);
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
512 ICallbackRegistration::Unregister(moveScpCallback_);
64
091fb1903bfc new wrapped function: orthanc.RegisterWorklistCallback() and orthanc.WorklistAnswers.WorklistAddAnswer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 63
diff changeset
513 ICallbackRegistration::Unregister(worklistScpCallback_);
63
32de70a1e4c7 New functions from the SDK wrapped in Python: CreateDicom, RegisterFindCallback, RegisterMoveCallback
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
514 }