# HG changeset patch # User Sebastien Jodogne # Date 1719924740 -7200 # Node ID d31f216c9462c9a83098180ef466eb40d3873f99 # Parent 20b004998fc2bfeaf43c601f5a4f0d26fa703c95 extracted custom functions/methods diff -r 20b004998fc2 -r d31f216c9462 CodeAnalysis/CustomFunctions.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CodeAnalysis/CustomFunctions.json Tue Jul 02 14:52:20 2024 +0200 @@ -0,0 +1,20 @@ +[ + { + "c_function" : "OrthancPluginCreateMemoryBuffer", + "args" : [ + { + "name" : "arg0", + "sdk_name" : "size", + "sdk_type" : "uint32_t" + } + ], + "documentation" : { + "args" : { + "size" : "Size of the memory buffer to be created" + }, + "return" : "The newly allocated memory buffer", + "description" : [ "Create a new memory buffer managed by the Orthanc core" ] + }, + "return_sdk_type" : "OrthancPluginMemoryBuffer *" + } +] diff -r 20b004998fc2 -r d31f216c9462 CodeAnalysis/CustomMethods.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CodeAnalysis/CustomMethods.json Tue Jul 02 14:52:20 2024 +0200 @@ -0,0 +1,73 @@ +{ + "OrthancPluginFindQuery" : [ + { + "short_name" : "GetFindQueryTagGroup", + "implementation" : "GetFindQueryTagGroup", + "sdk_function" : "OrthancPluginGetFindQueryTag", + "documentation" : { + "description" : [ "This function returns the group of one DICOM tag in the given C-Find query." ], + "args" : { + "index" : "The index of the tag of interest." + }, + "return" : "The value of the group." + }, + "args" : [ + { + "sdk_name" : "index", + "sdk_type" : "uint32_t" + } + ], + "return_sdk_type" : "uint16_t" + }, + + { + "short_name" : "GetFindQueryTagElement", + "implementation" : "GetFindQueryTagElement", + "sdk_function" : "OrthancPluginGetFindQueryTag", + "documentation" : { + "description" : [ "This function returns the element of one DICOM tag in the given C-Find query." ], + "args" : { + "index" : "The index of the tag of interest." + }, + "return" : "The value of the element." + }, + "args" : [ + { + "sdk_name" : "index", + "sdk_type" : "uint32_t" + } + ], + "return_sdk_type" : "uint16_t" + } + ], + + "OrthancPluginDicomInstance" : [ + { + "short_name" : "GetInstanceData", + "implementation" : "GetInstanceData", + "sdk_function" : "OrthancPluginGetInstanceData", + "documentation" : { + "description" : [ "Get the content of the DICOM instance." ], + "return" : "The DICOM data." + }, + "args" : [ + ], + "return_sdk_type" : "OrthancPluginMemoryBuffer *" + } + ], + + "OrthancPluginImage" : [ + { + "short_name" : "GetImageBuffer", + "implementation" : "GetImageBuffer", + "sdk_function" : "OrthancPluginGetImageBuffer", + "documentation" : { + "description" : [ "This function returns a pointer to the memory buffer that contains the pixels of the image." ], + "return" : "The pixel data." + }, + "args" : [ + ], + "return_sdk_type" : "OrthancPluginMemoryBuffer *" + } + ] +} diff -r 20b004998fc2 -r d31f216c9462 CodeAnalysis/GenerateOrthancSDK.py --- a/CodeAnalysis/GenerateOrthancSDK.py Tue Jul 02 14:06:56 2024 +0200 +++ b/CodeAnalysis/GenerateOrthancSDK.py Tue Jul 02 14:52:20 2024 +0200 @@ -53,105 +53,14 @@ ## implemented (not autogenerated) ## -CUSTOM_FUNCTIONS = [ - { - 'c_function' : 'OrthancPluginCreateMemoryBuffer', - 'args' : [ - { - 'name' : 'arg0', - 'sdk_name' : 'size', - 'sdk_type' : 'uint32_t', - } - ], - 'documentation' : { - 'args' : { - 'size' : 'Size of the memory buffer to be created', - }, - 'return' : 'The newly allocated memory buffer', - 'description' : [ 'Create a new memory buffer managed by the Orthanc core' ], - }, - 'return_sdk_type' : 'OrthancPluginMemoryBuffer *', - } -] +TARGET = os.path.realpath(args.target) -CUSTOM_METHODS = { - 'OrthancPluginFindQuery' : [ - { - 'short_name' : 'GetFindQueryTagGroup', - 'implementation' : 'GetFindQueryTagGroup', - 'sdk_function' : 'OrthancPluginGetFindQueryTag', - 'documentation' : { - 'description' : [ 'This function returns the group of one DICOM tag in the given C-Find query.' ], - 'args' : { - 'index' : 'The index of the tag of interest.', - }, - 'return' : 'The value of the group.', - }, - 'args' : [ - { - 'sdk_name' : 'index', - 'sdk_type' : 'uint32_t', - } - ], - 'return_sdk_type' : 'uint16_t', - }, +with open(os.path.join(ROOT, 'CustomMethods.json'), 'r') as f: + CUSTOM_METHODS = json.loads(f.read()) - { - 'short_name' : 'GetFindQueryTagElement', - 'implementation' : 'GetFindQueryTagElement', - 'sdk_function' : 'OrthancPluginGetFindQueryTag', - 'documentation' : { - 'description' : [ 'This function returns the element of one DICOM tag in the given C-Find query.' ], - 'args' : { - 'index' : 'The index of the tag of interest.', - }, - 'return' : 'The value of the element.', - }, - 'args' : [ - { - 'sdk_name' : 'index', - 'sdk_type' : 'uint32_t', - } - ], - 'return_sdk_type' : 'uint16_t', - }, - ], - - 'OrthancPluginDicomInstance' : [ - { - 'short_name' : 'GetInstanceData', - 'implementation' : 'GetInstanceData', - 'sdk_function' : 'OrthancPluginGetInstanceData', - 'documentation' : { - 'description' : [ 'Get the content of the DICOM instance.' ], - 'return' : 'The DICOM data.', - }, - 'args' : [ - ], - 'return_sdk_type' : 'OrthancPluginMemoryBuffer *', - }, - ], - - 'OrthancPluginImage' : [ - { - 'short_name' : 'GetImageBuffer', - 'implementation' : 'GetImageBuffer', - 'sdk_function' : 'OrthancPluginGetImageBuffer', - 'documentation' : { - 'description' : [ 'This function returns a pointer to the memory buffer that contains the pixels of the image.' ], - 'return' : 'The pixel data.', - }, - 'args' : [ - ], - 'return_sdk_type' : 'OrthancPluginMemoryBuffer *', - } - ], -} - - - -TARGET = os.path.realpath(args.target) +with open(os.path.join(ROOT, 'CustomFunctions.json'), 'r') as f: + CUSTOM_FUNCTIONS = json.loads(f.read()) partials = {}