comparison CodeAnalysis/GenerateOrthancSDK.py @ 183:d31f216c9462 java-code-model

extracted custom functions/methods
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 02 Jul 2024 14:52:20 +0200
parents 20b004998fc2
children f34f3a149c22
comparison
equal deleted inserted replaced
182:20b004998fc2 183:d31f216c9462
51 ## 51 ##
52 ## Configuration of the custom primitives that are manually 52 ## Configuration of the custom primitives that are manually
53 ## implemented (not autogenerated) 53 ## implemented (not autogenerated)
54 ## 54 ##
55 55
56 CUSTOM_FUNCTIONS = [
57 {
58 'c_function' : 'OrthancPluginCreateMemoryBuffer',
59 'args' : [
60 {
61 'name' : 'arg0',
62 'sdk_name' : 'size',
63 'sdk_type' : 'uint32_t',
64 }
65 ],
66 'documentation' : {
67 'args' : {
68 'size' : 'Size of the memory buffer to be created',
69 },
70 'return' : 'The newly allocated memory buffer',
71 'description' : [ 'Create a new memory buffer managed by the Orthanc core' ],
72 },
73 'return_sdk_type' : 'OrthancPluginMemoryBuffer *',
74 }
75 ]
76
77
78 CUSTOM_METHODS = {
79 'OrthancPluginFindQuery' : [
80 {
81 'short_name' : 'GetFindQueryTagGroup',
82 'implementation' : 'GetFindQueryTagGroup',
83 'sdk_function' : 'OrthancPluginGetFindQueryTag',
84 'documentation' : {
85 'description' : [ 'This function returns the group of one DICOM tag in the given C-Find query.' ],
86 'args' : {
87 'index' : 'The index of the tag of interest.',
88 },
89 'return' : 'The value of the group.',
90 },
91 'args' : [
92 {
93 'sdk_name' : 'index',
94 'sdk_type' : 'uint32_t',
95 }
96 ],
97 'return_sdk_type' : 'uint16_t',
98 },
99
100 {
101 'short_name' : 'GetFindQueryTagElement',
102 'implementation' : 'GetFindQueryTagElement',
103 'sdk_function' : 'OrthancPluginGetFindQueryTag',
104 'documentation' : {
105 'description' : [ 'This function returns the element of one DICOM tag in the given C-Find query.' ],
106 'args' : {
107 'index' : 'The index of the tag of interest.',
108 },
109 'return' : 'The value of the element.',
110 },
111 'args' : [
112 {
113 'sdk_name' : 'index',
114 'sdk_type' : 'uint32_t',
115 }
116 ],
117 'return_sdk_type' : 'uint16_t',
118 },
119 ],
120
121 'OrthancPluginDicomInstance' : [
122 {
123 'short_name' : 'GetInstanceData',
124 'implementation' : 'GetInstanceData',
125 'sdk_function' : 'OrthancPluginGetInstanceData',
126 'documentation' : {
127 'description' : [ 'Get the content of the DICOM instance.' ],
128 'return' : 'The DICOM data.',
129 },
130 'args' : [
131 ],
132 'return_sdk_type' : 'OrthancPluginMemoryBuffer *',
133 },
134 ],
135
136 'OrthancPluginImage' : [
137 {
138 'short_name' : 'GetImageBuffer',
139 'implementation' : 'GetImageBuffer',
140 'sdk_function' : 'OrthancPluginGetImageBuffer',
141 'documentation' : {
142 'description' : [ 'This function returns a pointer to the memory buffer that contains the pixels of the image.' ],
143 'return' : 'The pixel data.',
144 },
145 'args' : [
146 ],
147 'return_sdk_type' : 'OrthancPluginMemoryBuffer *',
148 }
149 ],
150 }
151
152
153
154 TARGET = os.path.realpath(args.target) 56 TARGET = os.path.realpath(args.target)
57
58
59 with open(os.path.join(ROOT, 'CustomMethods.json'), 'r') as f:
60 CUSTOM_METHODS = json.loads(f.read())
61
62 with open(os.path.join(ROOT, 'CustomFunctions.json'), 'r') as f:
63 CUSTOM_FUNCTIONS = json.loads(f.read())
155 64
156 65
157 partials = {} 66 partials = {}
158 67
159 with open(os.path.join(ROOT, 'FunctionBody.mustache'), 'r') as f: 68 with open(os.path.join(ROOT, 'FunctionBody.mustache'), 'r') as f: