Mercurial > hg > orthanc-python
changeset 268:dacb3c74e606
auto-generation of the wrapper during the build
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 12 Aug 2025 10:49:50 +0200 |
parents | 6eae1d3c5da1 |
children | ca5400c24f93 |
files | CMakeLists.txt CodeAnalysis/ClassDocumentation.json CodeAnalysis/GenerateOrthancSDK.py CodeAnalysis/sdk.cpp.mustache CodeAnalysis/sdk.h.mustache NEWS Resources/Builders/Debian/docker-internal.sh Resources/Builders/Dockerfile-MinGW-BuildEnvironment Resources/Builders/MinGW32-Python2.7/docker-internal.sh Resources/Builders/MinGW32-Python3.10/docker-internal.sh Resources/Builders/MinGW32-Python3.11/docker-internal.sh Resources/Builders/MinGW32-Python3.12/docker-internal.sh Resources/Builders/MinGW32-Python3.13/docker-internal.sh Resources/Builders/MinGW32-Python3.7/docker-internal.sh Resources/Builders/MinGW32-Python3.8/docker-internal.sh Resources/Builders/MinGW32-Python3.9/docker-internal.sh Resources/Builders/MinGW64-Python2.7/docker-internal.sh Resources/Builders/MinGW64-Python3.10/docker-internal.sh Resources/Builders/MinGW64-Python3.11/docker-internal.sh Resources/Builders/MinGW64-Python3.12/docker-internal.sh Resources/Builders/MinGW64-Python3.13/docker-internal.sh Resources/Builders/MinGW64-Python3.7/docker-internal.sh Resources/Builders/MinGW64-Python3.8/docker-internal.sh Resources/Builders/MinGW64-Python3.9/docker-internal.sh Sources/Autogenerated/orthanc.pyi Sources/Autogenerated/sdk.cpp Sources/Autogenerated/sdk.h Sources/Autogenerated/sdk_GlobalFunctions.impl.h Sources/Autogenerated/sdk_OrthancPluginChangeType.impl.h Sources/Autogenerated/sdk_OrthancPluginCompressionType.impl.h Sources/Autogenerated/sdk_OrthancPluginConstraintType.impl.h Sources/Autogenerated/sdk_OrthancPluginContentType.impl.h Sources/Autogenerated/sdk_OrthancPluginCreateDicomFlags.impl.h Sources/Autogenerated/sdk_OrthancPluginDicomInstance.impl.h Sources/Autogenerated/sdk_OrthancPluginDicomInstance.methods.h Sources/Autogenerated/sdk_OrthancPluginDicomToJsonFlags.impl.h Sources/Autogenerated/sdk_OrthancPluginDicomToJsonFormat.impl.h Sources/Autogenerated/sdk_OrthancPluginDicomWebBinaryMode.impl.h Sources/Autogenerated/sdk_OrthancPluginDicomWebNode.impl.h Sources/Autogenerated/sdk_OrthancPluginDicomWebNode.methods.h Sources/Autogenerated/sdk_OrthancPluginErrorCode.impl.h Sources/Autogenerated/sdk_OrthancPluginFindAnswers.impl.h Sources/Autogenerated/sdk_OrthancPluginFindAnswers.methods.h Sources/Autogenerated/sdk_OrthancPluginFindMatcher.impl.h Sources/Autogenerated/sdk_OrthancPluginFindMatcher.methods.h Sources/Autogenerated/sdk_OrthancPluginFindQuery.impl.h Sources/Autogenerated/sdk_OrthancPluginFindQuery.methods.h Sources/Autogenerated/sdk_OrthancPluginHttpAuthenticationStatus.impl.h Sources/Autogenerated/sdk_OrthancPluginHttpMethod.impl.h Sources/Autogenerated/sdk_OrthancPluginIdentifierConstraint.impl.h Sources/Autogenerated/sdk_OrthancPluginImage.impl.h Sources/Autogenerated/sdk_OrthancPluginImage.methods.h Sources/Autogenerated/sdk_OrthancPluginImageFormat.impl.h Sources/Autogenerated/sdk_OrthancPluginInstanceOrigin.impl.h Sources/Autogenerated/sdk_OrthancPluginJob.impl.h Sources/Autogenerated/sdk_OrthancPluginJob.methods.h Sources/Autogenerated/sdk_OrthancPluginJobStepStatus.impl.h Sources/Autogenerated/sdk_OrthancPluginJobStopReason.impl.h Sources/Autogenerated/sdk_OrthancPluginKeysValuesIterator.impl.h Sources/Autogenerated/sdk_OrthancPluginKeysValuesIterator.methods.h Sources/Autogenerated/sdk_OrthancPluginLoadDicomInstanceMode.impl.h Sources/Autogenerated/sdk_OrthancPluginLogCategory.impl.h Sources/Autogenerated/sdk_OrthancPluginLogLevel.impl.h Sources/Autogenerated/sdk_OrthancPluginMetricsType.impl.h Sources/Autogenerated/sdk_OrthancPluginPeers.impl.h Sources/Autogenerated/sdk_OrthancPluginPeers.methods.h Sources/Autogenerated/sdk_OrthancPluginPixelFormat.impl.h Sources/Autogenerated/sdk_OrthancPluginQueueOrigin.impl.h Sources/Autogenerated/sdk_OrthancPluginReceivedInstanceAction.impl.h Sources/Autogenerated/sdk_OrthancPluginResourceType.impl.h Sources/Autogenerated/sdk_OrthancPluginRestOutput.impl.h Sources/Autogenerated/sdk_OrthancPluginRestOutput.methods.h Sources/Autogenerated/sdk_OrthancPluginServerChunkedRequestReader.impl.h Sources/Autogenerated/sdk_OrthancPluginServerChunkedRequestReader.methods.h Sources/Autogenerated/sdk_OrthancPluginStableStatus.impl.h Sources/Autogenerated/sdk_OrthancPluginStorageArea.impl.h Sources/Autogenerated/sdk_OrthancPluginStorageArea.methods.h Sources/Autogenerated/sdk_OrthancPluginStorageCommitmentFailureReason.impl.h Sources/Autogenerated/sdk_OrthancPluginStoreStatus.impl.h Sources/Autogenerated/sdk_OrthancPluginValueRepresentation.impl.h Sources/Autogenerated/sdk_OrthancPluginWebDavCollection.impl.h Sources/Autogenerated/sdk_OrthancPluginWebDavCollection.methods.h Sources/Autogenerated/sdk_OrthancPluginWorklistAnswers.impl.h Sources/Autogenerated/sdk_OrthancPluginWorklistAnswers.methods.h Sources/Autogenerated/sdk_OrthancPluginWorklistQuery.impl.h Sources/Autogenerated/sdk_OrthancPluginWorklistQuery.methods.h Sources/DicomScpCallbacks.cpp Sources/IncomingHttpRequestFilter.cpp Sources/IncomingInstanceFilter.cpp Sources/OnStoredInstanceCallback.cpp Sources/Plugin.cpp Sources/RestCallbacks.cpp |
diffstat | 92 files changed, 218 insertions(+), 14308 deletions(-) [+] |
line wrap: on
line diff
--- a/CMakeLists.txt Tue Aug 12 09:31:45 2025 +0200 +++ b/CMakeLists.txt Tue Aug 12 10:49:50 2025 +0200 @@ -31,16 +31,23 @@ set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "mainline") set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg") else() - set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "1.12.6") + set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "1.12.9") set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web") endif() +## TODO +set(ORTHANC_CODE_MODEL ${CMAKE_SOURCE_DIR}/Resources/Orthanc/Sdk-1.12.9/orthanc/OrthancPluginCodeModel.json) + include(${CMAKE_SOURCE_DIR}/OrthancSDKVersion.cmake) +##################################################################### +## Parameters of the build +##################################################################### + if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") # The Python version cannot be controlled on OS X (yet) - set(PYTHON_VERSION "3.6" CACHE STRING "Version of Python to be used") + set(PYTHON_VERSION "3.13" CACHE STRING "Version of Python to be used") endif() if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") @@ -50,9 +57,7 @@ set(PYTHON_WINDOWS_USE_RELEASE_LIBS ON CACHE BOOL "Use the release Python libraries when building with Microsoft Visual Studio, even when compiling in _DEBUG mode (set it to OFF if you require linking to a Python debug build)") endif() - - -# Parameters of the build +# Generic parameters set(STATIC_BUILD OFF CACHE BOOL "Static build of the third-party libraries (necessary for Windows)") set(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages") set(ORTHANC_FRAMEWORK_SOURCE "${ORTHANC_FRAMEWORK_DEFAULT_SOURCE}" CACHE STRING "Source of the Orthanc framework (can be \"system\", \"hg\", \"archive\", \"web\" or \"path\")") @@ -66,7 +71,10 @@ mark_as_advanced(ORTHANC_FRAMEWORK_STATIC) -# Download and setup the Orthanc framework +##################################################################### +## Download and setup the Orthanc framework +##################################################################### + include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake) if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system") @@ -81,11 +89,11 @@ else() include(${ORTHANC_FRAMEWORK_ROOT}/../Resources/CMake/OrthancFrameworkParameters.cmake) - - #set(ENABLE_MODULE_IMAGES OFF CACHE INTERNAL "") - #set(ENABLE_MODULE_JOBS OFF CACHE INTERNAL "") - #set(ENABLE_MODULE_DICOM OFF CACHE INTERNAL "") - + + set(ENABLE_MODULE_IMAGES OFF CACHE INTERNAL "") + set(ENABLE_MODULE_JOBS OFF CACHE INTERNAL "") + set(ENABLE_MODULE_DICOM OFF CACHE INTERNAL "") + include(${ORTHANC_FRAMEWORK_ROOT}/../Resources/CMake/OrthancFrameworkConfiguration.cmake) include_directories(${ORTHANC_FRAMEWORK_ROOT}) endif() @@ -94,11 +102,22 @@ include(${CMAKE_SOURCE_DIR}/Resources/Orthanc/Plugins/OrthancPluginsExports.cmake) +##################################################################### +## Configure the Python library +##################################################################### + include(CheckIncludeFile) include(CheckIncludeFileCXX) include(CheckIncludeFiles) include(CheckLibraryExists) -include(FindPythonInterp) + +if(CMAKE_VERSION VERSION_GREATER "3.11") + find_package(Python REQUIRED COMPONENTS Interpreter) + set(PYTHON_EXECUTABLE ${Python_EXECUTABLE}) +else() + include(FindPythonInterp) + find_package(PythonInterp REQUIRED) +endif() if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") @@ -159,7 +178,9 @@ message(FATAL_ERROR "Error while computing the version information: ${Failure}") endif() - set(WINDOWS_RESOURCES ${CMAKE_CURRENT_BINARY_DIR}/Version.rc) + list(APPEND AUTOGENERATED_SOURCES + ${CMAKE_CURRENT_BINARY_DIR}/Version.rc + ) else() find_package(PkgConfig REQUIRED) @@ -177,26 +198,71 @@ endif() +##################################################################### +## Find the Orthanc SDK +##################################################################### + if (USE_FRAMEWORK_ORTHANC_SDK) include_directories( ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Include ) + set(ORTHANC_SDK ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h) else() include_directories( ${CMAKE_SOURCE_DIR}/Resources/Orthanc/Sdk-${ORTHANC_SDK_VERSION} ) + set(ORTHANC_SDK ${CMAKE_SOURCE_DIR}/Resources/Orthanc/Sdk-${ORTHANC_SDK_VERSION}/orthanc/OrthancCPlugin.h) endif() + +##################################################################### +## Auto-generate the wrapper +##################################################################### + +add_custom_command( + OUTPUT + ${AUTOGENERATED_DIR}/sdk/orthanc.pyi + ${AUTOGENERATED_DIR}/sdk/sdk.cpp + ${AUTOGENERATED_DIR}/sdk/sdk.h + COMMAND + ${PYTHON_EXECUTABLE} + ${CMAKE_SOURCE_DIR}/CodeAnalysis/GenerateOrthancSDK.py + --sdk ${ORTHANC_SDK} + --model ${ORTHANC_CODE_MODEL} + --target ${AUTOGENERATED_DIR}/sdk/ + DEPENDS + ${CMAKE_SOURCE_DIR}/CodeAnalysis/ + ${ORTHANC_SDK} + ${ORTHANC_CODE_MODEL} + ) + +list(APPEND AUTOGENERATED_SOURCES + ${AUTOGENERATED_DIR}/sdk/sdk.cpp + ) + +add_custom_target( + AutogeneratedTarget + DEPENDS + ${AUTOGENERATED_SOURCES} + ) + + + +##################################################################### +## Build the plugin +##################################################################### + add_definitions( -DHAS_ORTHANC_EXCEPTION=0 ) include_directories( ${PYTHON_INCLUDE_DIRS} + ${AUTOGENERATED_DIR}/sdk/ ) add_library(OrthancPython SHARED - Sources/Autogenerated/sdk.cpp + ${AUTOGENERATED_SOURCES} Sources/DicomScpCallbacks.cpp Sources/ICallbackRegistration.cpp Sources/IncomingHttpRequestFilter.cpp @@ -220,16 +286,20 @@ ${CMAKE_SOURCE_DIR}/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp ${BOOST_SOURCES} ${JSONCPP_SOURCES} - ${WINDOWS_RESOURCES} ) if (CMAKE_COMPILER_IS_GNUCXX) - # Don't report warnings about deprecated functions in the Orthanc SDK set_source_files_properties( - Sources/Autogenerated/sdk.cpp - PROPERTIES COMPILE_FLAGS -Wno-deprecated-declarations) + ${AUTOGENERATED_DIR}/sdk/sdk.cpp + PROPERTIES + INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/Sources/;${CMAKE_SOURCE_DIR}/Resources/Orthanc/Plugins/" + + # Don't report warnings about deprecated functions in the Orthanc SDK + COMPILE_FLAGS -Wno-deprecated-declarations) endif() +add_dependencies(OrthancPython AutogeneratedTarget) + target_link_libraries(OrthancPython ${PYTHON_LIBRARIES}) add_definitions( @@ -242,10 +312,14 @@ SOVERSION ${PLUGIN_VERSION} ) -configure_file( - Sources/Autogenerated/orthanc.pyi +add_custom_command(TARGET OrthancPython + POST_BUILD + COMMAND + ${CMAKE_COMMAND} -E copy + ${AUTOGENERATED_DIR}/sdk/orthanc.pyi ${CMAKE_CURRENT_BINARY_DIR}/orthanc.pyi - COPYONLY) + COMMENT "Copying the Python stub interface" VERBATIM + ) install( TARGETS OrthancPython
--- a/CodeAnalysis/ClassDocumentation.json Tue Aug 12 09:31:45 2025 +0200 +++ b/CodeAnalysis/ClassDocumentation.json Tue Aug 12 10:49:50 2025 +0200 @@ -6,6 +6,7 @@ "OrthancPluginFindQuery" : "DICOM C-FIND query", "OrthancPluginImage" : "2D image managed by the Orthanc core", "OrthancPluginJob" : "Orthanc job", + "OrthancPluginKeysValuesIterator" : "Iterator over the keys and values of a key-value store", "OrthancPluginPeers" : "Orthanc peer", "OrthancPluginRestOutput" : "Output for a call to the REST API of Orthanc", "OrthancPluginServerChunkedRequestReader" : "Read for a chunked HTTP request",
--- a/CodeAnalysis/GenerateOrthancSDK.py Tue Aug 12 09:31:45 2025 +0200 +++ b/CodeAnalysis/GenerateOrthancSDK.py Tue Aug 12 10:49:50 2025 +0200 @@ -56,11 +56,14 @@ default = os.path.join(ROOT, '../Resources/Orthanc/Sdk-%s/orthanc/OrthancPluginCodeModel.json' % CMAKE_ORTHANC_SDK_VERSION), help = 'Input code model, as generated by the orthanc project') parser.add_argument('--target', - default = os.path.join(ROOT, '../Sources/Autogenerated'), + default = os.path.join(ROOT, '/tmp/PythonAutogenerated/'), help = 'Target folder') args = parser.parse_args() +TARGET = os.path.realpath(args.target) +os.makedirs(TARGET, exist_ok = True) + ## ## Detect the actual version of the Orthanc SDK @@ -113,14 +116,14 @@ return True +print('\n** Generating the Python wrapper for Orthanc SDK %d.%d.%d **' % (SDK_VERSION[0], SDK_VERSION[1], SDK_VERSION[2])) + + ## ## Configuration of the custom primitives that are manually ## implemented (not autogenerated) ## -TARGET = os.path.realpath(args.target) - - with open(os.path.join(ROOT, 'CustomMethods.json'), 'r') as f: CUSTOM_METHODS = json.loads(f.read()) @@ -147,7 +150,7 @@ model = json.loads(f.read()) with open(os.path.join(ROOT, 'ClassDocumentation.json'), 'r') as f: - classes_description = json.loads(f.read()) + classes_documentation = json.loads(f.read()) def ToUpperCase(name): @@ -472,7 +475,7 @@ custom_methods.append(custom_method) classes.append({ - 'description' : classes_description[c['name']], + 'description' : classes_documentation[c['name']], 'class_name' : c['name'], 'short_name' : GetShortName(c['name']), 'methods' : methods, @@ -549,12 +552,12 @@ print('\nNumber of automatically wrapped global functions: %d' % len(sortedGlobalFunctions)) print('Number of automatically wrapped methods: %d' % countWrappedMethods) print('Number of automatically wrapped destructors: %d' % countDestructors) + +totalWrapped = (len(sortedGlobalFunctions) + countWrappedMethods + countDestructors) +print('=> Total number of automatically wrapped functions (including destructors): %d\n' % totalWrapped) + print('Number of manually implemented (custom) global functions: %d' % len(sortedCustomFunctions)) print('Number of manually implemented (custom) methods: %d' % countCustomMethods) -totalWrapped = (len(sortedGlobalFunctions) + countWrappedMethods + countDestructors) -print('\nTotal number of automatically wrapped functions (including destructors): %d' % totalWrapped) -print('NB: This number must correspond to "ParseOrthancSDK.py" in "orthanc-java"') - total = totalWrapped + len(sortedCustomFunctions) + countCustomMethods -print('\n=> Total number of functions or methods in the Python SDK: %d\n' % total) +print('=> Total number of functions or methods in the Python wrapper: %d\n' % total)
--- a/CodeAnalysis/sdk.cpp.mustache Tue Aug 12 09:31:45 2025 +0200 +++ b/CodeAnalysis/sdk.cpp.mustache Tue Aug 12 10:49:50 2025 +0200 @@ -27,12 +27,13 @@ // WARNING: Auto-generated file. Do not modify it by hand. -#include "sdk.h" +#include <PythonHeaderWrapper.h> // Must be before "sdk.h" +#include "./sdk.h" -#include "../PythonLock.h" -#include "../PythonThreadsAllower.h" +#include <PythonLock.h> +#include <PythonThreadsAllower.h> -#include "../../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h" +#include <OrthancPluginCppWrapper.h> {{#enumerations}} #include "./sdk_{{name}}.impl.h"
--- a/CodeAnalysis/sdk.h.mustache Tue Aug 12 09:31:45 2025 +0200 +++ b/CodeAnalysis/sdk.h.mustache Tue Aug 12 10:49:50 2025 +0200 @@ -29,8 +29,6 @@ #pragma once -#include "../PythonHeaderWrapper.h" - void RegisterOrthancSdk(PyObject* module); PyMethodDef* GetOrthancSdkFunctions();
--- a/NEWS Tue Aug 12 09:31:45 2025 +0200 +++ b/NEWS Tue Aug 12 10:49:50 2025 +0200 @@ -1,9 +1,12 @@ Pending changes in the mainline =============================== -=> Minimum SDK version: 1.12.9 <= +=> Maximum SDK version: 1.12.9 <= -* New methods imported from SDK 1.12.9 (TODO: sync again once released) +* The auto-generation of the Python wrapper is now part of the build, + to exploit the ORTHANC_PLUGIN_SINCE_SDK macro to provide backward + compatibility with the SDK that is actually installed on the system +* New methods imported from SDK 1.12.9 (TODO: sync again once released): - AuditLog() - SetStableStatus() * Added Windows builder for Python 3.13
--- a/Resources/Builders/Debian/docker-internal.sh Tue Aug 12 09:31:45 2025 +0200 +++ b/Resources/Builders/Debian/docker-internal.sh Tue Aug 12 10:49:50 2025 +0200 @@ -69,10 +69,12 @@ mkdir /tmp/source-writeable -cp -r /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/OrthancSDKVersion.cmake /tmp/source-writeable/ + +cp -r /source/CodeAnalysis /tmp/source-writeable/ +cp -r /source/Resources /tmp/source-writeable/ cp -r /source/Sources /tmp/source-writeable/ -cp -r /source/Resources /tmp/source-writeable/ -cp -r /source/OrthancSDKVersion.cmake /tmp/source-writeable/ mkdir /tmp/build cd /tmp/build
--- a/Resources/Builders/Dockerfile-MinGW-BuildEnvironment Tue Aug 12 09:31:45 2025 +0200 +++ b/Resources/Builders/Dockerfile-MinGW-BuildEnvironment Tue Aug 12 10:49:50 2025 +0200 @@ -24,12 +24,12 @@ # 2021-09-15: We don't use "debian:bullseye-slim", as the "mercurial" package # fails to install on CBlue -FROM debian:buster-slim +FROM debian:bookworm-slim MAINTAINER Sebastien Jodogne <s.jodogne@gmail.com> LABEL Description="Orthanc, free DICOM server" Vendor="The Orthanc project" RUN apt-get -y clean && apt-get -y update && \ DEBIAN_FRONTEND=noninteractive apt-get -y install \ - nano unzip cmake mingw-w64 patch wget bzip2 python mercurial && \ + nano unzip cmake mingw-w64 patch wget bzip2 python3 mercurial python3-pystache && \ apt-get clean && rm -rf /var/lib/apt/lists/*
--- a/Resources/Builders/MinGW32-Python2.7/docker-internal.sh Tue Aug 12 09:31:45 2025 +0200 +++ b/Resources/Builders/MinGW32-Python2.7/docker-internal.sh Tue Aug 12 10:49:50 2025 +0200 @@ -28,10 +28,12 @@ mkdir /tmp/source-writeable -cp -r /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/OrthancSDKVersion.cmake /tmp/source-writeable/ + +cp -r /source/CodeAnalysis /tmp/source-writeable/ +cp -r /source/Resources /tmp/source-writeable/ cp -r /source/Sources /tmp/source-writeable/ -cp -r /source/Resources /tmp/source-writeable/ -cp -r /source/OrthancSDKVersion.cmake /tmp/source-writeable/ mkdir /tmp/build cd /tmp/build
--- a/Resources/Builders/MinGW32-Python3.10/docker-internal.sh Tue Aug 12 09:31:45 2025 +0200 +++ b/Resources/Builders/MinGW32-Python3.10/docker-internal.sh Tue Aug 12 10:49:50 2025 +0200 @@ -28,10 +28,12 @@ mkdir /tmp/source-writeable -cp -r /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/OrthancSDKVersion.cmake /tmp/source-writeable/ + +cp -r /source/CodeAnalysis /tmp/source-writeable/ +cp -r /source/Resources /tmp/source-writeable/ cp -r /source/Sources /tmp/source-writeable/ -cp -r /source/Resources /tmp/source-writeable/ -cp -r /source/OrthancSDKVersion.cmake /tmp/source-writeable/ mkdir /tmp/build cd /tmp/build
--- a/Resources/Builders/MinGW32-Python3.11/docker-internal.sh Tue Aug 12 09:31:45 2025 +0200 +++ b/Resources/Builders/MinGW32-Python3.11/docker-internal.sh Tue Aug 12 10:49:50 2025 +0200 @@ -28,10 +28,12 @@ mkdir /tmp/source-writeable -cp -r /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/OrthancSDKVersion.cmake /tmp/source-writeable/ + +cp -r /source/CodeAnalysis /tmp/source-writeable/ +cp -r /source/Resources /tmp/source-writeable/ cp -r /source/Sources /tmp/source-writeable/ -cp -r /source/Resources /tmp/source-writeable/ -cp -r /source/OrthancSDKVersion.cmake /tmp/source-writeable/ mkdir /tmp/build cd /tmp/build
--- a/Resources/Builders/MinGW32-Python3.12/docker-internal.sh Tue Aug 12 09:31:45 2025 +0200 +++ b/Resources/Builders/MinGW32-Python3.12/docker-internal.sh Tue Aug 12 10:49:50 2025 +0200 @@ -28,10 +28,12 @@ mkdir /tmp/source-writeable -cp -r /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/OrthancSDKVersion.cmake /tmp/source-writeable/ + +cp -r /source/CodeAnalysis /tmp/source-writeable/ +cp -r /source/Resources /tmp/source-writeable/ cp -r /source/Sources /tmp/source-writeable/ -cp -r /source/Resources /tmp/source-writeable/ -cp -r /source/OrthancSDKVersion.cmake /tmp/source-writeable/ mkdir /tmp/build cd /tmp/build
--- a/Resources/Builders/MinGW32-Python3.13/docker-internal.sh Tue Aug 12 09:31:45 2025 +0200 +++ b/Resources/Builders/MinGW32-Python3.13/docker-internal.sh Tue Aug 12 10:49:50 2025 +0200 @@ -28,10 +28,12 @@ mkdir /tmp/source-writeable -cp -r /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/OrthancSDKVersion.cmake /tmp/source-writeable/ + +cp -r /source/CodeAnalysis /tmp/source-writeable/ +cp -r /source/Resources /tmp/source-writeable/ cp -r /source/Sources /tmp/source-writeable/ -cp -r /source/Resources /tmp/source-writeable/ -cp -r /source/OrthancSDKVersion.cmake /tmp/source-writeable/ mkdir /tmp/build cd /tmp/build
--- a/Resources/Builders/MinGW32-Python3.7/docker-internal.sh Tue Aug 12 09:31:45 2025 +0200 +++ b/Resources/Builders/MinGW32-Python3.7/docker-internal.sh Tue Aug 12 10:49:50 2025 +0200 @@ -28,10 +28,12 @@ mkdir /tmp/source-writeable -cp -r /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/OrthancSDKVersion.cmake /tmp/source-writeable/ + +cp -r /source/CodeAnalysis /tmp/source-writeable/ +cp -r /source/Resources /tmp/source-writeable/ cp -r /source/Sources /tmp/source-writeable/ -cp -r /source/Resources /tmp/source-writeable/ -cp -r /source/OrthancSDKVersion.cmake /tmp/source-writeable/ mkdir /tmp/build cd /tmp/build
--- a/Resources/Builders/MinGW32-Python3.8/docker-internal.sh Tue Aug 12 09:31:45 2025 +0200 +++ b/Resources/Builders/MinGW32-Python3.8/docker-internal.sh Tue Aug 12 10:49:50 2025 +0200 @@ -28,10 +28,12 @@ mkdir /tmp/source-writeable -cp -r /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/OrthancSDKVersion.cmake /tmp/source-writeable/ + +cp -r /source/CodeAnalysis /tmp/source-writeable/ +cp -r /source/Resources /tmp/source-writeable/ cp -r /source/Sources /tmp/source-writeable/ -cp -r /source/Resources /tmp/source-writeable/ -cp -r /source/OrthancSDKVersion.cmake /tmp/source-writeable/ mkdir /tmp/build cd /tmp/build
--- a/Resources/Builders/MinGW32-Python3.9/docker-internal.sh Tue Aug 12 09:31:45 2025 +0200 +++ b/Resources/Builders/MinGW32-Python3.9/docker-internal.sh Tue Aug 12 10:49:50 2025 +0200 @@ -28,10 +28,12 @@ mkdir /tmp/source-writeable -cp -r /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/OrthancSDKVersion.cmake /tmp/source-writeable/ + +cp -r /source/CodeAnalysis /tmp/source-writeable/ +cp -r /source/Resources /tmp/source-writeable/ cp -r /source/Sources /tmp/source-writeable/ -cp -r /source/Resources /tmp/source-writeable/ -cp -r /source/OrthancSDKVersion.cmake /tmp/source-writeable/ mkdir /tmp/build cd /tmp/build
--- a/Resources/Builders/MinGW64-Python2.7/docker-internal.sh Tue Aug 12 09:31:45 2025 +0200 +++ b/Resources/Builders/MinGW64-Python2.7/docker-internal.sh Tue Aug 12 10:49:50 2025 +0200 @@ -28,10 +28,12 @@ mkdir /tmp/source-writeable -cp -r /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/OrthancSDKVersion.cmake /tmp/source-writeable/ + +cp -r /source/CodeAnalysis /tmp/source-writeable/ +cp -r /source/Resources /tmp/source-writeable/ cp -r /source/Sources /tmp/source-writeable/ -cp -r /source/Resources /tmp/source-writeable/ -cp -r /source/OrthancSDKVersion.cmake /tmp/source-writeable/ mkdir /tmp/build cd /tmp/build
--- a/Resources/Builders/MinGW64-Python3.10/docker-internal.sh Tue Aug 12 09:31:45 2025 +0200 +++ b/Resources/Builders/MinGW64-Python3.10/docker-internal.sh Tue Aug 12 10:49:50 2025 +0200 @@ -28,10 +28,12 @@ mkdir /tmp/source-writeable -cp -r /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/OrthancSDKVersion.cmake /tmp/source-writeable/ + +cp -r /source/CodeAnalysis /tmp/source-writeable/ +cp -r /source/Resources /tmp/source-writeable/ cp -r /source/Sources /tmp/source-writeable/ -cp -r /source/Resources /tmp/source-writeable/ -cp -r /source/OrthancSDKVersion.cmake /tmp/source-writeable/ mkdir /tmp/build cd /tmp/build
--- a/Resources/Builders/MinGW64-Python3.11/docker-internal.sh Tue Aug 12 09:31:45 2025 +0200 +++ b/Resources/Builders/MinGW64-Python3.11/docker-internal.sh Tue Aug 12 10:49:50 2025 +0200 @@ -28,10 +28,12 @@ mkdir /tmp/source-writeable -cp -r /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/OrthancSDKVersion.cmake /tmp/source-writeable/ + +cp -r /source/CodeAnalysis /tmp/source-writeable/ +cp -r /source/Resources /tmp/source-writeable/ cp -r /source/Sources /tmp/source-writeable/ -cp -r /source/Resources /tmp/source-writeable/ -cp -r /source/OrthancSDKVersion.cmake /tmp/source-writeable/ mkdir /tmp/build cd /tmp/build
--- a/Resources/Builders/MinGW64-Python3.12/docker-internal.sh Tue Aug 12 09:31:45 2025 +0200 +++ b/Resources/Builders/MinGW64-Python3.12/docker-internal.sh Tue Aug 12 10:49:50 2025 +0200 @@ -28,10 +28,12 @@ mkdir /tmp/source-writeable -cp -r /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/OrthancSDKVersion.cmake /tmp/source-writeable/ + +cp -r /source/CodeAnalysis /tmp/source-writeable/ +cp -r /source/Resources /tmp/source-writeable/ cp -r /source/Sources /tmp/source-writeable/ -cp -r /source/Resources /tmp/source-writeable/ -cp -r /source/OrthancSDKVersion.cmake /tmp/source-writeable/ mkdir /tmp/build cd /tmp/build
--- a/Resources/Builders/MinGW64-Python3.13/docker-internal.sh Tue Aug 12 09:31:45 2025 +0200 +++ b/Resources/Builders/MinGW64-Python3.13/docker-internal.sh Tue Aug 12 10:49:50 2025 +0200 @@ -28,10 +28,12 @@ mkdir /tmp/source-writeable -cp -r /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/OrthancSDKVersion.cmake /tmp/source-writeable/ + +cp -r /source/CodeAnalysis /tmp/source-writeable/ +cp -r /source/Resources /tmp/source-writeable/ cp -r /source/Sources /tmp/source-writeable/ -cp -r /source/Resources /tmp/source-writeable/ -cp -r /source/OrthancSDKVersion.cmake /tmp/source-writeable/ mkdir /tmp/build cd /tmp/build
--- a/Resources/Builders/MinGW64-Python3.7/docker-internal.sh Tue Aug 12 09:31:45 2025 +0200 +++ b/Resources/Builders/MinGW64-Python3.7/docker-internal.sh Tue Aug 12 10:49:50 2025 +0200 @@ -28,10 +28,12 @@ mkdir /tmp/source-writeable -cp -r /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/OrthancSDKVersion.cmake /tmp/source-writeable/ + +cp -r /source/CodeAnalysis /tmp/source-writeable/ +cp -r /source/Resources /tmp/source-writeable/ cp -r /source/Sources /tmp/source-writeable/ -cp -r /source/Resources /tmp/source-writeable/ -cp -r /source/OrthancSDKVersion.cmake /tmp/source-writeable/ mkdir /tmp/build cd /tmp/build
--- a/Resources/Builders/MinGW64-Python3.8/docker-internal.sh Tue Aug 12 09:31:45 2025 +0200 +++ b/Resources/Builders/MinGW64-Python3.8/docker-internal.sh Tue Aug 12 10:49:50 2025 +0200 @@ -28,10 +28,12 @@ mkdir /tmp/source-writeable -cp -r /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/OrthancSDKVersion.cmake /tmp/source-writeable/ + +cp -r /source/CodeAnalysis /tmp/source-writeable/ +cp -r /source/Resources /tmp/source-writeable/ cp -r /source/Sources /tmp/source-writeable/ -cp -r /source/Resources /tmp/source-writeable/ -cp -r /source/OrthancSDKVersion.cmake /tmp/source-writeable/ mkdir /tmp/build cd /tmp/build
--- a/Resources/Builders/MinGW64-Python3.9/docker-internal.sh Tue Aug 12 09:31:45 2025 +0200 +++ b/Resources/Builders/MinGW64-Python3.9/docker-internal.sh Tue Aug 12 10:49:50 2025 +0200 @@ -28,10 +28,12 @@ mkdir /tmp/source-writeable -cp -r /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/CMakeLists.txt /tmp/source-writeable/ +cp /source/OrthancSDKVersion.cmake /tmp/source-writeable/ + +cp -r /source/CodeAnalysis /tmp/source-writeable/ +cp -r /source/Resources /tmp/source-writeable/ cp -r /source/Sources /tmp/source-writeable/ -cp -r /source/Resources /tmp/source-writeable/ -cp -r /source/OrthancSDKVersion.cmake /tmp/source-writeable/ mkdir /tmp/build cd /tmp/build
--- a/Sources/Autogenerated/orthanc.pyi Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3341 +0,0 @@ -# SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain -# SPDX-License-Identifier: AGPL-3.0-or-later - -## -## Python plugin for Orthanc -## Copyright (C) 2020-2023 Osimis S.A., Belgium -## Copyright (C) 2024-2025 Orthanc Team SRL, Belgium -## Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium -## -## This program is free software: you can redistribute it and/or -## modify it under the terms of the GNU Affero General Public License -## as published by the Free Software Foundation, either version 3 of -## the License, or (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Affero General Public License for more details. -## -## You should have received a copy of the GNU Affero General Public License -## along with this program. If not, see <http://www.gnu.org/licenses/>. -## - - -# WARNING: Auto-generated file. Do not modify it by hand. - - -import typing - - - -class ChangeType(): - """ - The supported types of changes that can be signaled to the change callback. Note: This enumeration is not used to store changes in the database! - """ - - """ - Series is now complete - """ - COMPLETED_SERIES: int = 0, - - """ - Deleted resource - """ - DELETED: int = 1, - - """ - A new instance was added to this resource - """ - NEW_CHILD_INSTANCE: int = 2, - - """ - New instance received - """ - NEW_INSTANCE: int = 3, - - """ - New patient created - """ - NEW_PATIENT: int = 4, - - """ - New series created - """ - NEW_SERIES: int = 5, - - """ - New study created - """ - NEW_STUDY: int = 6, - - """ - Timeout: No new instance in this patient - """ - STABLE_PATIENT: int = 7, - - """ - Timeout: No new instance in this series - """ - STABLE_SERIES: int = 8, - - """ - Timeout: No new instance in this study - """ - STABLE_STUDY: int = 9, - - """ - Orthanc has started - """ - ORTHANC_STARTED: int = 10, - - """ - Orthanc is stopping - """ - ORTHANC_STOPPED: int = 11, - - """ - Some user-defined attachment has changed for this resource - """ - UPDATED_ATTACHMENT: int = 12, - - """ - Some user-defined metadata has changed for this resource - """ - UPDATED_METADATA: int = 13, - - """ - The list of Orthanc peers has changed - """ - UPDATED_PEERS: int = 14, - - """ - The list of DICOM modalities has changed - """ - UPDATED_MODALITIES: int = 15, - - """ - New Job submitted - """ - JOB_SUBMITTED: int = 16, - - """ - A Job has completed successfully - """ - JOB_SUCCESS: int = 17, - - """ - A Job has failed - """ - JOB_FAILURE: int = 18, - -class CompressionType(): - """ - The compression algorithms that are supported by the Orthanc core. - """ - - """ - Standard zlib compression - """ - ZLIB: int = 0, - - """ - zlib, prefixed with uncompressed size (uint64_t) - """ - ZLIB_WITH_SIZE: int = 1, - - """ - Standard gzip compression - """ - GZIP: int = 2, - - """ - gzip, prefixed with uncompressed size (uint64_t) - """ - GZIP_WITH_SIZE: int = 3, - -class ConstraintType(): - """ - The constraints on the tags (main DICOM tags and identifier tags) that must be supported by the database plugins. - """ - - """ - Equal - """ - EQUAL: int = 1, - - """ - Less or equal - """ - SMALLER_OR_EQUAL: int = 2, - - """ - More or equal - """ - GREATER_OR_EQUAL: int = 3, - - """ - Wildcard matching - """ - WILDCARD: int = 4, - - """ - List of values - """ - LIST: int = 5, - -class ContentType(): - """ - The content types that are supported by Orthanc plugins. - """ - - """ - Unknown content type - """ - UNKNOWN: int = 0, - - """ - DICOM - """ - DICOM: int = 1, - - """ - JSON summary of a DICOM file - """ - DICOM_AS_JSON: int = 2, - - """ - DICOM Header till pixel data - """ - DICOM_UNTIL_PIXEL_DATA: int = 3, - -class CreateDicomFlags(): - """ - Flags for the creation of a DICOM file. - """ - - """ - Default mode - """ - NONE: int = 0, - - """ - Decode fields encoded using data URI scheme - """ - DECODE_DATA_URI_SCHEME: int = 1, - - """ - Automatically generate DICOM identifiers - """ - GENERATE_IDENTIFIERS: int = 2, - -class DicomToJsonFlags(): - """ - Flags to customize a DICOM-to-JSON conversion. By default, binary tags are formatted using Data URI scheme. - """ - - """ - Default formatting - """ - NONE: int = 0, - - """ - Include the binary tags - """ - INCLUDE_BINARY: int = 1, - - """ - Include the private tags - """ - INCLUDE_PRIVATE_TAGS: int = 2, - - """ - Include the tags unknown by the dictionary - """ - INCLUDE_UNKNOWN_TAGS: int = 4, - - """ - Include the pixel data - """ - INCLUDE_PIXEL_DATA: int = 8, - - """ - Output binary tags as-is, dropping non-ASCII - """ - CONVERT_BINARY_TO_ASCII: int = 16, - - """ - Signal binary tags as null values - """ - CONVERT_BINARY_TO_NULL: int = 32, - - """ - Stop processing after pixel data (new in 1.9.1) - """ - STOP_AFTER_PIXEL_DATA: int = 64, - - """ - Skip tags whose element is zero (new in 1.9.1) - """ - SKIP_GROUP_LENGTHS: int = 128, - -class DicomToJsonFormat(): - """ - The possible output formats for a DICOM-to-JSON conversion. - """ - - """ - Full output, with most details - """ - FULL: int = 1, - - """ - Tags output as hexadecimal numbers - """ - SHORT: int = 2, - - """ - Human-readable JSON - """ - HUMAN: int = 3, - -class DicomWebBinaryMode(): - """ - The available modes to export a binary DICOM tag into a DICOMweb JSON or XML document. - """ - - """ - Don't include binary tags - """ - IGNORE: int = 0, - - """ - Inline encoding using Base64 - """ - INLINE_BINARY: int = 1, - - """ - Use a bulk data URI field - """ - BULK_DATA_URI: int = 2, - -class ErrorCode(): - """ - The various error codes that can be returned by the Orthanc core. - """ - - """ - Internal error - """ - INTERNAL_ERROR: int = -1, - - """ - Success - """ - SUCCESS: int = 0, - - """ - Error encountered within the plugin engine - """ - PLUGIN: int = 1, - - """ - Not implemented yet - """ - NOT_IMPLEMENTED: int = 2, - - """ - Parameter out of range - """ - PARAMETER_OUT_OF_RANGE: int = 3, - - """ - The server hosting Orthanc is running out of memory - """ - NOT_ENOUGH_MEMORY: int = 4, - - """ - Bad type for a parameter - """ - BAD_PARAMETER_TYPE: int = 5, - - """ - Bad sequence of calls - """ - BAD_SEQUENCE_OF_CALLS: int = 6, - - """ - Accessing an inexistent item - """ - INEXISTENT_ITEM: int = 7, - - """ - Bad request - """ - BAD_REQUEST: int = 8, - - """ - Error in the network protocol - """ - NETWORK_PROTOCOL: int = 9, - - """ - Error while calling a system command - """ - SYSTEM_COMMAND: int = 10, - - """ - Error with the database engine - """ - DATABASE: int = 11, - - """ - Badly formatted URI - """ - URI_SYNTAX: int = 12, - - """ - Inexistent file - """ - INEXISTENT_FILE: int = 13, - - """ - Cannot write to file - """ - CANNOT_WRITE_FILE: int = 14, - - """ - Bad file format - """ - BAD_FILE_FORMAT: int = 15, - - """ - Timeout - """ - TIMEOUT: int = 16, - - """ - Unknown resource - """ - UNKNOWN_RESOURCE: int = 17, - - """ - Incompatible version of the database - """ - INCOMPATIBLE_DATABASE_VERSION: int = 18, - - """ - The file storage is full - """ - FULL_STORAGE: int = 19, - - """ - Corrupted file (e.g. inconsistent MD5 hash) - """ - CORRUPTED_FILE: int = 20, - - """ - Inexistent tag - """ - INEXISTENT_TAG: int = 21, - - """ - Cannot modify a read-only data structure - """ - READ_ONLY: int = 22, - - """ - Incompatible format of the images - """ - INCOMPATIBLE_IMAGE_FORMAT: int = 23, - - """ - Incompatible size of the images - """ - INCOMPATIBLE_IMAGE_SIZE: int = 24, - - """ - Error while using a shared library (plugin) - """ - SHARED_LIBRARY: int = 25, - - """ - Plugin invoking an unknown service - """ - UNKNOWN_PLUGIN_SERVICE: int = 26, - - """ - Unknown DICOM tag - """ - UNKNOWN_DICOM_TAG: int = 27, - - """ - Cannot parse a JSON document - """ - BAD_JSON: int = 28, - - """ - Bad credentials were provided to an HTTP request - """ - UNAUTHORIZED: int = 29, - - """ - Badly formatted font file - """ - BAD_FONT: int = 30, - - """ - The plugin implementing a custom database back-end does not fulfill the proper interface - """ - DATABASE_PLUGIN: int = 31, - - """ - Error in the plugin implementing a custom storage area - """ - STORAGE_AREA_PLUGIN: int = 32, - - """ - The request is empty - """ - EMPTY_REQUEST: int = 33, - - """ - Cannot send a response which is acceptable according to the Accept HTTP header - """ - NOT_ACCEPTABLE: int = 34, - - """ - Cannot handle a NULL pointer - """ - NULL_POINTER: int = 35, - - """ - The database is currently not available (probably a transient situation) - """ - DATABASE_UNAVAILABLE: int = 36, - - """ - This job was canceled - """ - CANCELED_JOB: int = 37, - - """ - Geometry error encountered in Stone - """ - BAD_GEOMETRY: int = 38, - - """ - Cannot initialize SSL encryption, check out your certificates - """ - SSL_INITIALIZATION: int = 39, - - """ - Calling a function that has been removed from the Orthanc Framework - """ - DISCONTINUED_ABI: int = 40, - - """ - Incorrect range request - """ - BAD_RANGE: int = 41, - - """ - Database could not serialize access due to concurrent update, the transaction should be retried - """ - DATABASE_CANNOT_SERIALIZE: int = 42, - - """ - A bad revision number was provided, which might indicate conflict between multiple writers - """ - REVISION: int = 43, - - """ - A main DICOM Tag has been defined multiple times for the same resource level - """ - MAIN_DICOM_TAGS_MULTIPLY_DEFINED: int = 44, - - """ - Access to a resource is forbidden - """ - FORBIDDEN_ACCESS: int = 45, - - """ - Duplicate resource - """ - DUPLICATE_RESOURCE: int = 46, - - """ - Your configuration file contains configuration that are mutually incompatible - """ - INCOMPATIBLE_CONFIGURATIONS: int = 47, - - """ - SQLite: The database is not opened - """ - SQLITE_NOT_OPENED: int = 1000, - - """ - SQLite: Connection is already open - """ - SQLITE_ALREADY_OPENED: int = 1001, - - """ - SQLite: Unable to open the database - """ - SQLITE_CANNOT_OPEN: int = 1002, - - """ - SQLite: This cached statement is already being referred to - """ - SQLITE_STATEMENT_ALREADY_USED: int = 1003, - - """ - SQLite: Cannot execute a command - """ - SQLITE_EXECUTE: int = 1004, - - """ - SQLite: Rolling back a nonexistent transaction (have you called Begin()?) - """ - SQLITE_ROLLBACK_WITHOUT_TRANSACTION: int = 1005, - - """ - SQLite: Committing a nonexistent transaction - """ - SQLITE_COMMIT_WITHOUT_TRANSACTION: int = 1006, - - """ - SQLite: Unable to register a function - """ - SQLITE_REGISTER_FUNCTION: int = 1007, - - """ - SQLite: Unable to flush the database - """ - SQLITE_FLUSH: int = 1008, - - """ - SQLite: Cannot run a cached statement - """ - SQLITE_CANNOT_RUN: int = 1009, - - """ - SQLite: Cannot step over a cached statement - """ - SQLITE_CANNOT_STEP: int = 1010, - - """ - SQLite: Bind a value while out of range (serious error) - """ - SQLITE_BIND_OUT_OF_RANGE: int = 1011, - - """ - SQLite: Cannot prepare a cached statement - """ - SQLITE_PREPARE_STATEMENT: int = 1012, - - """ - SQLite: Beginning the same transaction twice - """ - SQLITE_TRANSACTION_ALREADY_STARTED: int = 1013, - - """ - SQLite: Failure when committing the transaction - """ - SQLITE_TRANSACTION_COMMIT: int = 1014, - - """ - SQLite: Cannot start a transaction - """ - SQLITE_TRANSACTION_BEGIN: int = 1015, - - """ - The directory to be created is already occupied by a regular file - """ - DIRECTORY_OVER_FILE: int = 2000, - - """ - Unable to create a subdirectory or a file in the file storage - """ - FILE_STORAGE_CANNOT_WRITE: int = 2001, - - """ - The specified path does not point to a directory - """ - DIRECTORY_EXPECTED: int = 2002, - - """ - The TCP port of the HTTP server is privileged or already in use - """ - HTTP_PORT_IN_USE: int = 2003, - - """ - The TCP port of the DICOM server is privileged or already in use - """ - DICOM_PORT_IN_USE: int = 2004, - - """ - This HTTP status is not allowed in a REST API - """ - BAD_HTTP_STATUS_IN_REST: int = 2005, - - """ - The specified path does not point to a regular file - """ - REGULAR_FILE_EXPECTED: int = 2006, - - """ - Unable to get the path to the executable - """ - PATH_TO_EXECUTABLE: int = 2007, - - """ - Cannot create a directory - """ - MAKE_DIRECTORY: int = 2008, - - """ - An application entity title (AET) cannot be empty or be longer than 16 characters - """ - BAD_APPLICATION_ENTITY_TITLE: int = 2009, - - """ - No request handler factory for DICOM C-FIND SCP - """ - NO_CFIND_HANDLER: int = 2010, - - """ - No request handler factory for DICOM C-MOVE SCP - """ - NO_CMOVE_HANDLER: int = 2011, - - """ - No request handler factory for DICOM C-STORE SCP - """ - NO_CSTORE_HANDLER: int = 2012, - - """ - No application entity filter - """ - NO_APPLICATION_ENTITY_FILTER: int = 2013, - - """ - DicomUserConnection: Unable to find the SOP class and instance - """ - NO_SOP_CLASS_OR_INSTANCE: int = 2014, - - """ - DicomUserConnection: No acceptable presentation context for modality - """ - NO_PRESENTATION_CONTEXT: int = 2015, - - """ - DicomUserConnection: The C-FIND command is not supported by the remote SCP - """ - DICOM_FIND_UNAVAILABLE: int = 2016, - - """ - DicomUserConnection: The C-MOVE command is not supported by the remote SCP - """ - DICOM_MOVE_UNAVAILABLE: int = 2017, - - """ - Cannot store an instance - """ - CANNOT_STORE_INSTANCE: int = 2018, - - """ - Only string values are supported when creating DICOM instances - """ - CREATE_DICOM_NOT_STRING: int = 2019, - - """ - Trying to override a value inherited from a parent module - """ - CREATE_DICOM_OVERRIDE_TAG: int = 2020, - - """ - Use \"Content\" to inject an image into a new DICOM instance - """ - CREATE_DICOM_USE_CONTENT: int = 2021, - - """ - No payload is present for one instance in the series - """ - CREATE_DICOM_NO_PAYLOAD: int = 2022, - - """ - The payload of the DICOM instance must be specified according to Data URI scheme - """ - CREATE_DICOM_USE_DATA_URI_SCHEME: int = 2023, - - """ - Trying to attach a new DICOM instance to an inexistent resource - """ - CREATE_DICOM_BAD_PARENT: int = 2024, - - """ - Trying to attach a new DICOM instance to an instance (must be a series, study or patient) - """ - CREATE_DICOM_PARENT_IS_INSTANCE: int = 2025, - - """ - Unable to get the encoding of the parent resource - """ - CREATE_DICOM_PARENT_ENCODING: int = 2026, - - """ - Unknown modality - """ - UNKNOWN_MODALITY: int = 2027, - - """ - Bad ordering of filters in a job - """ - BAD_JOB_ORDERING: int = 2028, - - """ - Cannot convert the given JSON object to a Lua table - """ - JSON_TO_LUA_TABLE: int = 2029, - - """ - Cannot create the Lua context - """ - CANNOT_CREATE_LUA: int = 2030, - - """ - Cannot execute a Lua command - """ - CANNOT_EXECUTE_LUA: int = 2031, - - """ - Arguments cannot be pushed after the Lua function is executed - """ - LUA_ALREADY_EXECUTED: int = 2032, - - """ - The Lua function does not give the expected number of outputs - """ - LUA_BAD_OUTPUT: int = 2033, - - """ - The Lua function is not a predicate (only true/false outputs allowed) - """ - NOT_LUA_PREDICATE: int = 2034, - - """ - The Lua function does not return a string - """ - LUA_RETURNS_NO_STRING: int = 2035, - - """ - Another plugin has already registered a custom storage area - """ - STORAGE_AREA_ALREADY_REGISTERED: int = 2036, - - """ - Another plugin has already registered a custom database back-end - """ - DATABASE_BACKEND_ALREADY_REGISTERED: int = 2037, - - """ - Plugin trying to call the database during its initialization - """ - DATABASE_NOT_INITIALIZED: int = 2038, - - """ - Orthanc has been built without SSL support - """ - SSL_DISABLED: int = 2039, - - """ - Unable to order the slices of the series - """ - CANNOT_ORDER_SLICES: int = 2040, - - """ - No request handler factory for DICOM C-Find Modality SCP - """ - NO_WORKLIST_HANDLER: int = 2041, - - """ - Cannot override the value of a tag that already exists - """ - ALREADY_EXISTING_TAG: int = 2042, - - """ - No request handler factory for DICOM N-ACTION SCP (storage commitment) - """ - NO_STORAGE_COMMITMENT_HANDLER: int = 2043, - - """ - No request handler factory for DICOM C-GET SCP - """ - NO_CGET_HANDLER: int = 2044, - - """ - DicomUserConnection: The C-GET command is not supported by the remote SCP - """ - DICOM_GET_UNAVAILABLE: int = 2045, - - """ - Unsupported media type - """ - UNSUPPORTED_MEDIA_TYPE: int = 3000, - -class HttpMethod(): - """ - The various HTTP methods for a REST call. - """ - - """ - GET request - """ - GET: int = 1, - - """ - POST request - """ - POST: int = 2, - - """ - PUT request - """ - PUT: int = 3, - - """ - DELETE request - """ - DELETE: int = 4, - -class IdentifierConstraint(): - """ - The constraints on the DICOM identifiers that must be supported by the database plugins. - """ - - """ - Equal - """ - EQUAL: int = 1, - - """ - Less or equal - """ - SMALLER_OR_EQUAL: int = 2, - - """ - More or equal - """ - GREATER_OR_EQUAL: int = 3, - - """ - Case-sensitive wildcard matching (with * and ?) - """ - WILDCARD: int = 4, - -class ImageFormat(): - """ - The image formats that are supported by the Orthanc core. - """ - - """ - Image compressed using PNG - """ - PNG: int = 0, - - """ - Image compressed using JPEG - """ - JPEG: int = 1, - - """ - Image compressed using DICOM - """ - DICOM: int = 2, - -class InstanceOrigin(): - """ - The origin of a DICOM instance that has been received by Orthanc. - """ - - """ - Unknown origin - """ - UNKNOWN: int = 1, - - """ - Instance received through DICOM protocol - """ - DICOM_PROTOCOL: int = 2, - - """ - Instance received through REST API of Orthanc - """ - REST_API: int = 3, - - """ - Instance added to Orthanc by a plugin - """ - PLUGIN: int = 4, - - """ - Instance added to Orthanc by a Lua script - """ - LUA: int = 5, - - """ - Instance received through WebDAV (new in 1.8.0) - """ - WEB_DAV: int = 6, - -class JobStepStatus(): - """ - The possible status for one single step of a job. - """ - - """ - The job has successfully executed all its steps - """ - SUCCESS: int = 1, - - """ - The job has failed while executing this step - """ - FAILURE: int = 2, - - """ - The job has still data to process after this step - """ - CONTINUE: int = 3, - -class JobStopReason(): - """ - Explains why the job should stop and release the resources it has allocated. This is especially important to disambiguate between the "paused" condition and the "final" conditions (success, failure, or canceled). - """ - - """ - The job has succeeded - """ - SUCCESS: int = 1, - - """ - The job was paused, and will be resumed later - """ - PAUSED: int = 2, - - """ - The job has failed, and might be resubmitted later - """ - FAILURE: int = 3, - - """ - The job was canceled, and might be resubmitted later - """ - CANCELED: int = 4, - -class LoadDicomInstanceMode(): - """ - Mode specifying how to load a DICOM instance. - """ - - """ - Load the whole DICOM file, including pixel data - """ - WHOLE_DICOM: int = 1, - - """ - Load the whole DICOM file until pixel data, which speeds up the loading - """ - UNTIL_PIXEL_DATA: int = 2, - - """ - Load the whole DICOM file until pixel data, and replace pixel data by an empty tag whose VR (value representation) is the same as those of the original DICOM file - """ - EMPTY_PIXEL_DATA: int = 3, - -class LogCategory(): - """ - The log categories supported by Orthanc. These values must match those of enumeration "LogCategory" in the Orthanc Core. - """ - - """ - Generic (default) category - """ - GENERIC: int = 1, - - """ - Plugin engine related logs (shall not be used by plugins) - """ - PLUGINS: int = 2, - - """ - HTTP related logs - """ - HTTP: int = 4, - - """ - SQLite related logs (shall not be used by plugins) - """ - SQLITE: int = 8, - - """ - DICOM related logs - """ - DICOM: int = 16, - - """ - jobs related logs - """ - JOBS: int = 32, - - """ - Lua related logs (shall not be used by plugins) - """ - LUA: int = 64, - -class LogLevel(): - """ - The log levels supported by Orthanc. These values must match those of enumeration "LogLevel" in the Orthanc Core. - """ - - """ - Error log level - """ - ERROR: int = 0, - - """ - Warning log level - """ - WARNING: int = 1, - - """ - Info log level - """ - INFO: int = 2, - - """ - Trace log level - """ - TRACE: int = 3, - -class MetricsType(): - """ - The available types of metrics. - """ - - """ - Default metrics - """ - DEFAULT: int = 0, - - """ - This metrics represents a time duration. Orthanc will keep the maximum value of the metrics over a sliding window of ten seconds, which is useful if the metrics is sampled frequently. - """ - TIMER: int = 1, - -class PixelFormat(): - """ - The memory layout of the pixels of an image. - """ - - """ - Graylevel 8bpp image. The image is graylevel. Each pixel is unsigned and stored in one byte. - """ - GRAYSCALE8: int = 1, - - """ - Graylevel, unsigned 16bpp image. The image is graylevel. Each pixel is unsigned and stored in two bytes. - """ - GRAYSCALE16: int = 2, - - """ - Graylevel, signed 16bpp image. The image is graylevel. Each pixel is signed and stored in two bytes. - """ - SIGNED_GRAYSCALE16: int = 3, - - """ - Color image in RGB24 format. This format describes a color image. The pixels are stored in 3 consecutive bytes. The memory layout is RGB. - """ - RGB24: int = 4, - - """ - Color image in RGBA32 format. This format describes a color image. The pixels are stored in 4 consecutive bytes. The memory layout is RGBA. - """ - RGBA32: int = 5, - - """ - Unknown pixel format - """ - UNKNOWN: int = 6, - - """ - Color image in RGB48 format. This format describes a color image. The pixels are stored in 6 consecutive bytes. The memory layout is RRGGBB. - """ - RGB48: int = 7, - - """ - Graylevel, unsigned 32bpp image. The image is graylevel. Each pixel is unsigned and stored in four bytes. - """ - GRAYSCALE32: int = 8, - - """ - Graylevel, floating-point 32bpp image. The image is graylevel. Each pixel is floating-point and stored in four bytes. - """ - FLOAT32: int = 9, - - """ - Color image in BGRA32 format. This format describes a color image. The pixels are stored in 4 consecutive bytes. The memory layout is BGRA. - """ - BGRA32: int = 10, - - """ - Graylevel, unsigned 64bpp image. The image is graylevel. Each pixel is unsigned and stored in eight bytes. - """ - GRAYSCALE64: int = 11, - -class ReceivedInstanceAction(): - """ - The action to be taken after ReceivedInstanceCallback is triggered - """ - - """ - Keep the instance as is - """ - KEEP_AS_IS: int = 1, - - """ - Modify the instance - """ - MODIFY: int = 2, - - """ - Discard the instance - """ - DISCARD: int = 3, - -class ResourceType(): - """ - The supported types of DICOM resources. - """ - - """ - Patient - """ - PATIENT: int = 0, - - """ - Study - """ - STUDY: int = 1, - - """ - Series - """ - SERIES: int = 2, - - """ - Instance - """ - INSTANCE: int = 3, - - """ - Unavailable resource type - """ - NONE: int = 4, - -class StorageCommitmentFailureReason(): - """ - The available values for the Failure Reason (0008,1197) during storage commitment. http://dicom.nema.org/medical/dicom/2019e/output/chtml/part03/sect_C.14.html#sect_C.14.1.1 - """ - - """ - Success: The DICOM instance is properly stored in the SCP - """ - SUCCESS: int = 0, - - """ - 0110H: A general failure in processing the operation was encountered - """ - PROCESSING_FAILURE: int = 1, - - """ - 0112H: One or more of the elements in the Referenced SOP Instance Sequence was not available - """ - NO_SUCH_OBJECT_INSTANCE: int = 2, - - """ - 0213H: The SCP does not currently have enough resources to store the requested SOP Instance(s) - """ - RESOURCE_LIMITATION: int = 3, - - """ - 0122H: Storage Commitment has been requested for a SOP Instance with a SOP Class that is not supported by the SCP - """ - REFERENCED_SOPCLASS_NOT_SUPPORTED: int = 4, - - """ - 0119H: The SOP Class of an element in the Referenced SOP Instance Sequence did not correspond to the SOP class registered for this SOP Instance at the SCP - """ - CLASS_INSTANCE_CONFLICT: int = 5, - - """ - 0131H: The Transaction UID of the Storage Commitment Request is already in use - """ - DUPLICATE_TRANSACTION_UID: int = 6, - -class ValueRepresentation(): - """ - The value representations present in the DICOM standard (version 2013). - """ - - """ - Application Entity - """ - AE: int = 1, - - """ - Age String - """ - AS: int = 2, - - """ - Attribute Tag - """ - AT: int = 3, - - """ - Code String - """ - CS: int = 4, - - """ - Date - """ - DA: int = 5, - - """ - Decimal String - """ - DS: int = 6, - - """ - Date Time - """ - DT: int = 7, - - """ - Floating Point Double - """ - FD: int = 8, - - """ - Floating Point Single - """ - FL: int = 9, - - """ - Integer String - """ - IS: int = 10, - - """ - Long String - """ - LO: int = 11, - - """ - Long Text - """ - LT: int = 12, - - """ - Other Byte String - """ - OB: int = 13, - - """ - Other Float String - """ - OF: int = 14, - - """ - Other Word String - """ - OW: int = 15, - - """ - Person Name - """ - PN: int = 16, - - """ - Short String - """ - SH: int = 17, - - """ - Signed Long - """ - SL: int = 18, - - """ - Sequence of Items - """ - SQ: int = 19, - - """ - Signed Short - """ - SS: int = 20, - - """ - Short Text - """ - ST: int = 21, - - """ - Time - """ - TM: int = 22, - - """ - Unique Identifier (UID) - """ - UI: int = 23, - - """ - Unsigned Long - """ - UL: int = 24, - - """ - Unknown - """ - UN: int = 25, - - """ - Unsigned Short - """ - US: int = 26, - - """ - Unlimited Text - """ - UT: int = 27, - - - -# This function returns the MIME type of a file by inspecting its extension -def AutodetectMimeType(path: str) -> str: - """ - This function returns the MIME type of a file by inspecting its extension. - - Args: - path (str): Path to the file. - - Returns: - str: The MIME type. This is a statically-allocated string, do not free it. - """ - ... - -# This function compresses or decompresses a buffer, using the version of the zlib library that is used by the Orthanc core -def BufferCompression(source: bytes, compression: CompressionType, uncompress: int) -> bytes: - """ - This function compresses or decompresses a buffer, using the version of the zlib library that is used by the Orthanc core. - - Args: - source (bytes): The source buffer. - compression (CompressionType): The compression algorithm. - uncompress (int): If set to "0", the buffer must be compressed. If set to "1", the buffer must be uncompressed. - - Returns: - bytes: 0 if success, or the error code if failure. - """ - ... - -# This function checks whether the version of the Orthanc server running this plugin, is above the version of the current Orthanc SDK header -def CheckVersion() -> int: - """ - This function checks whether the version of the Orthanc server running this plugin, is above the version of the current Orthanc SDK header. This guarantees that the plugin is compatible with the hosting Orthanc (i.e. it will not call unavailable services). The result of this function should always be checked in the OrthancPluginInitialize() entry point of the plugin. - - Returns: - int: 1 if and only if the versions are compatible. If the result is 0, the initialization of the plugin should fail. - """ - ... - -# This function checks whether the version of the Orthanc server running this plugin, is above the given version -def CheckVersionAdvanced(expected_major: int, expected_minor: int, expected_revision: int) -> int: - """ - This function checks whether the version of the Orthanc server running this plugin, is above the given version. Contrarily to OrthancPluginCheckVersion(), it is up to the developer of the plugin to make sure that all the Orthanc SDK services called by the plugin are actually implemented in the given version of Orthanc. - - Args: - expected_major (int): Expected major version. - expected_minor (int): Expected minor version. - expected_revision (int): Expected revision. - - Returns: - int: 1 if and only if the versions are compatible. If the result is 0, the initialization of the plugin should fail. - """ - ... - -# This function compresses the given memory buffer containing an image using the JPEG specification, and stores the result of the compression into a newly allocated memory buffer -def CompressJpegImage(format: PixelFormat, width: int, height: int, pitch: int, buffer: bytes, quality: int) -> bytes: - """ - This function compresses the given memory buffer containing an image using the JPEG specification, and stores the result of the compression into a newly allocated memory buffer. - - Args: - format (PixelFormat): The memory layout of the uncompressed image. - width (int): The width of the image. - height (int): The height of the image. - pitch (int): The pitch of the image (i.e. the number of bytes between 2 successive lines of the image in the memory buffer). - buffer (bytes): The memory buffer containing the uncompressed image. - quality (int): The quality of the JPEG encoding, between 1 (worst quality, best compression) and 100 (best quality, worst compression). - - Returns: - bytes: 0 if success, or the error code if failure. - """ - ... - -# This function compresses the given memory buffer containing an image using the PNG specification, and stores the result of the compression into a newly allocated memory buffer -def CompressPngImage(format: PixelFormat, width: int, height: int, pitch: int, buffer: bytes) -> bytes: - """ - This function compresses the given memory buffer containing an image using the PNG specification, and stores the result of the compression into a newly allocated memory buffer. - - Args: - format (PixelFormat): The memory layout of the uncompressed image. - width (int): The width of the image. - height (int): The height of the image. - pitch (int): The pitch of the image (i.e. the number of bytes between 2 successive lines of the image in the memory buffer). - buffer (bytes): The memory buffer containing the uncompressed image. - - Returns: - bytes: 0 if success, or the error code if failure. - """ - ... - -# This functions computes the MD5 cryptographic hash of the given memory buffer -def ComputeMd5(buffer: bytes) -> str: - """ - This functions computes the MD5 cryptographic hash of the given memory buffer. - - Args: - buffer (bytes): The source memory buffer. - - Returns: - str: The NULL value in case of error, or a string containing the cryptographic hash. This string must be freed by OrthancPluginFreeString(). - """ - ... - -# This functions computes the SHA-1 cryptographic hash of the given memory buffer -def ComputeSha1(buffer: bytes) -> str: - """ - This functions computes the SHA-1 cryptographic hash of the given memory buffer. - - Args: - buffer (bytes): The source memory buffer. - - Returns: - str: The NULL value in case of error, or a string containing the cryptographic hash. This string must be freed by OrthancPluginFreeString(). - """ - ... - -# This function takes as input a string containing a JSON file describing the content of a DICOM instance -def CreateDicom(json: str, pixel_data: Image, flags: CreateDicomFlags) -> bytes: - """ - This function takes as input a string containing a JSON file describing the content of a DICOM instance. As an output, it writes the corresponding DICOM instance to a newly allocated memory buffer. Additionally, an image to be encoded within the DICOM instance can also be provided. - Private tags will be associated with the private creator whose value is specified in the "DefaultPrivateCreator" configuration option of Orthanc. The function OrthancPluginCreateDicom2() can be used if another private creator must be used to create this instance. - - Args: - json (str): The input JSON file. - pixel_data (Image): The image. Can be NULL, if the pixel data is encoded inside the JSON with the data URI scheme. - flags (CreateDicomFlags): Flags governing the output. - - Returns: - bytes: 0 if success, other value if error. - """ - ... - -# This function takes as input a string containing a JSON file describing the content of a DICOM instance -def CreateDicom2(json: str, pixel_data: Image, flags: CreateDicomFlags, private_creator: str) -> bytes: - """ - This function takes as input a string containing a JSON file describing the content of a DICOM instance. As an output, it writes the corresponding DICOM instance to a newly allocated memory buffer. Additionally, an image to be encoded within the DICOM instance can also be provided. - Contrarily to the function OrthancPluginCreateDicom(), this function can be explicitly provided with a private creator. - - Args: - json (str): The input JSON file. - pixel_data (Image): The image. Can be NULL, if the pixel data is encoded inside the JSON with the data URI scheme. - flags (CreateDicomFlags): Flags governing the output. - private_creator (str): The private creator to be used for the private DICOM tags. Check out the global configuration option "Dictionary" of Orthanc. - - Returns: - bytes: 0 if success, other value if error. - """ - ... - -# This function parses a memory buffer that contains a DICOM file -def CreateDicomInstance(buffer: bytes) -> DicomInstance: - """ - This function parses a memory buffer that contains a DICOM file. The function returns a new pointer to a data structure that is managed by the Orthanc core. - - Args: - buffer (bytes): The memory buffer containing the DICOM instance. - - Returns: - DicomInstance: The newly allocated DICOM instance. It must be freed with OrthancPluginFreeDicomInstance(). - """ - ... - -# This function creates a "matcher" object that can be used to check whether a DICOM instance matches a C-Find query -def CreateFindMatcher(query: bytes) -> FindMatcher: - """ - This function creates a "matcher" object that can be used to check whether a DICOM instance matches a C-Find query. The C-Find query must be expressed as a DICOM buffer. - - Args: - query (bytes): The C-Find DICOM query. - - Returns: - FindMatcher: The newly allocated matcher. It must be freed with OrthancPluginFreeFindMatcher(). - """ - ... - -# This function creates an image of given size and format -def CreateImage(format: PixelFormat, width: int, height: int) -> Image: - """ - This function creates an image of given size and format. - - Args: - format (PixelFormat): The format of the pixels. - width (int): The width of the image. - height (int): The height of the image. - - Returns: - Image: The newly allocated image. It must be freed with OrthancPluginFreeImage(). - """ - ... - -# This function decodes one frame of a DICOM image that is stored in a memory buffer -def DecodeDicomImage(buffer: bytes, frame_index: int) -> Image: - """ - This function decodes one frame of a DICOM image that is stored in a memory buffer. This function will give the same result as OrthancPluginUncompressImage() for single-frame DICOM images. - - Args: - buffer (bytes): Pointer to a memory buffer containing the DICOM image. - frame_index (int): The index of the frame of interest in a multi-frame image. - - Returns: - Image: The uncompressed image. It must be freed with OrthancPluginFreeImage(). - """ - ... - -# This function takes as input a memory buffer containing a DICOM file, and outputs a JSON string representing the tags of this DICOM file -def DicomBufferToJson(buffer: bytes, format: DicomToJsonFormat, flags: DicomToJsonFlags, max_string_length: int) -> str: - """ - This function takes as input a memory buffer containing a DICOM file, and outputs a JSON string representing the tags of this DICOM file. - - Args: - buffer (bytes): The memory buffer containing the DICOM file. - format (DicomToJsonFormat): The output format. - flags (DicomToJsonFlags): Flags governing the output. - max_string_length (int): The maximum length of a field. Too long fields will be output as "null". The 0 value means no maximum length. - - Returns: - str: The NULL value if the case of an error, or the JSON string. This string must be freed by OrthancPluginFreeString(). - """ - ... - -# This function formats a DICOM instance that is stored in Orthanc, and outputs a JSON string representing the tags of this DICOM instance -def DicomInstanceToJson(instance_id: str, format: DicomToJsonFormat, flags: DicomToJsonFlags, max_string_length: int) -> str: - """ - This function formats a DICOM instance that is stored in Orthanc, and outputs a JSON string representing the tags of this DICOM instance. - - Args: - instance_id (str): The Orthanc identifier of the instance. - format (DicomToJsonFormat): The output format. - flags (DicomToJsonFlags): Flags governing the output. - max_string_length (int): The maximum length of a field. Too long fields will be output as "null". The 0 value means no maximum length. - - Returns: - str: The NULL value if the case of an error, or the JSON string. This string must be freed by OrthancPluginFreeString(). - """ - ... - -# Add JavaScript code to customize the default behavior of Orthanc Explorer -def ExtendOrthancExplorer(javascript: str) -> None: - """ - Add JavaScript code to customize the default behavior of Orthanc Explorer. This can for instance be used to add new buttons. - - Args: - javascript (str): The custom JavaScript code. - """ - ... - -# Add JavaScript code to customize the default behavior of Orthanc Explorer -def ExtendOrthancExplorer2(plugin: str, javascript: str) -> None: - """ - Add JavaScript code to customize the default behavior of Orthanc Explorer. This can for instance be used to add new buttons. - - Args: - plugin (str): Identifier of your plugin (it must match "OrthancPluginGetName()"). - javascript (str): The custom JavaScript code. - """ - ... - -# This function generates a token that can be set in the HTTP header "Authorization" so as to grant full access to the REST API of Orthanc using an external HTTP client -def GenerateRestApiAuthorizationToken() -> str: - """ - This function generates a token that can be set in the HTTP header "Authorization" so as to grant full access to the REST API of Orthanc using an external HTTP client. Using this function avoids the need of adding a separate user in the "RegisteredUsers" configuration of Orthanc, which eases deployments. - This feature is notably useful in multiprocess scenarios, where a subprocess created by a plugin has no access to the "OrthancPluginContext", and thus cannot call "OrthancPluginRestApi[Get|Post|Put|Delete]()". - This situation is frequently encountered in Python plugins, where the "multiprocessing" package can be used to bypass the Global Interpreter Lock (GIL) and thus to improve performance and concurrency. - - Returns: - str: The authorization token, or NULL value in the case of an error. This string must be freed by OrthancPluginFreeString(). - """ - ... - -# Generate a random GUID/UUID (globally unique identifier) -def GenerateUuid() -> str: - """ - Generate a random GUID/UUID (globally unique identifier). - - Returns: - str: NULL in the case of an error, or a newly allocated string containing the UUID. This string must be freed by OrthancPluginFreeString(). - """ - ... - -# Get the value of one of the command-line arguments that were used to launch Orthanc -def GetCommandLineArgument(argument: int) -> str: - """ - Get the value of one of the command-line arguments that were used to launch Orthanc. The number of available arguments can be retrieved by OrthancPluginGetCommandLineArgumentsCount(). - - Args: - argument (int): The index of the argument. - - Returns: - str: The value of the argument, or NULL in the case of an error. This string must be freed by OrthancPluginFreeString(). - """ - ... - -# Retrieve the number of command-line arguments that were used to launch Orthanc -def GetCommandLineArgumentsCount() -> int: - """ - Retrieve the number of command-line arguments that were used to launch Orthanc. - - Returns: - int: The number of arguments. - """ - ... - -# This function returns the content of the configuration that is used by Orthanc, formatted as a JSON string -def GetConfiguration() -> str: - """ - This function returns the content of the configuration that is used by Orthanc, formatted as a JSON string. - - Returns: - str: NULL in the case of an error, or a newly allocated string containing the configuration. This string must be freed by OrthancPluginFreeString(). - """ - ... - -# This function returns the path to the configuration file(s) that was specified when starting Orthanc -def GetConfigurationPath() -> str: - """ - This function returns the path to the configuration file(s) that was specified when starting Orthanc. Since version 0.9.1, this path can refer to a folder that stores a set of configuration files. This function is deprecated in favor of OrthancPluginGetConfiguration(). - - Returns: - str: NULL in the case of an error, or a newly allocated string containing the path. This string must be freed by OrthancPluginFreeString(). - """ - ... - -def GetDatabaseServerIdentifier() -> str: - """ - - Returns: - str: the database server identifier. This is a statically-allocated string, do not free it. - """ - ... - -# Retrieve a DICOM instance using its Orthanc identifier -def GetDicomForInstance(instance_id: str) -> bytes: - """ - Retrieve a DICOM instance using its Orthanc identifier. The DICOM file is stored into a newly allocated memory buffer. - - Args: - instance_id (str): The Orthanc identifier of the DICOM instance of interest. - - Returns: - bytes: 0 if success, or the error code if failure. - """ - ... - -# This function returns the description of a given error code -def GetErrorDescription(error: ErrorCode) -> str: - """ - This function returns the description of a given error code. - - Args: - error (ErrorCode): The error code of interest. - - Returns: - str: The error description. This is a statically-allocated string, do not free it. - """ - ... - -# Retrieve the expected version of the database schema -def GetExpectedDatabaseVersion() -> int: - """ - Retrieve the expected version of the database schema. - - Returns: - int: The version. - """ - ... - -# This function returns the name of a font that is built in the Orthanc core -def GetFontName(font_index: int) -> str: - """ - This function returns the name of a font that is built in the Orthanc core. - - Args: - font_index (int): The index of the font. This value must be less than OrthancPluginGetFontsCount(). - - Returns: - str: The font name. This is a statically-allocated string, do not free it. - """ - ... - -# This function returns the size of a font that is built in the Orthanc core -def GetFontSize(font_index: int) -> int: - """ - This function returns the size of a font that is built in the Orthanc core. - - Args: - font_index (int): The index of the font. This value must be less than OrthancPluginGetFontsCount(). - - Returns: - int: The font size. - """ - ... - -# This function returns the number of fonts that are built in the Orthanc core -def GetFontsCount() -> int: - """ - This function returns the number of fonts that are built in the Orthanc core. These fonts can be used to draw texts on images through OrthancPluginDrawText(). - - Returns: - int: The number of fonts. - """ - ... - -# Get the value of a global property that is stored in the Orthanc database -def GetGlobalProperty(property: int, default_value: str) -> str: - """ - Get the value of a global property that is stored in the Orthanc database. Global properties whose index is below 1024 are reserved by Orthanc. - - Args: - property (int): The global property of interest. - default_value (str): The value to return, if the global property is unset. - - Returns: - str: The value of the global property, or NULL in the case of an error. This string must be freed by OrthancPluginFreeString(). - """ - ... - -# This function returns the path to the directory containing the Orthanc executable -def GetOrthancDirectory() -> str: - """ - This function returns the path to the directory containing the Orthanc executable. - - Returns: - str: NULL in the case of an error, or a newly allocated string containing the path. This string must be freed by OrthancPluginFreeString(). - """ - ... - -# This function returns the path to the Orthanc executable -def GetOrthancPath() -> str: - """ - This function returns the path to the Orthanc executable. - - Returns: - str: NULL in the case of an error, or a newly allocated string containing the path. This string must be freed by OrthancPluginFreeString(). - """ - ... - -# This function returns the parameters of the Orthanc peers that are known to the Orthanc server hosting the plugin -def GetPeers() -> Peers: - """ - This function returns the parameters of the Orthanc peers that are known to the Orthanc server hosting the plugin. - - Returns: - Peers: NULL if error, or a newly allocated opaque data structure containing the peers. This structure must be freed with OrthancPluginFreePeers(). - """ - ... - -# This function makes a lookup to the dictionary of DICOM tags that are known to Orthanc, and returns the symbolic name of a DICOM tag -def GetTagName(group: int, element: int, private_creator: str) -> str: - """ - This function makes a lookup to the dictionary of DICOM tags that are known to Orthanc, and returns the symbolic name of a DICOM tag. - - Args: - group (int): The group of the tag. - element (int): The element of the tag. - private_creator (str): For private tags, the name of the private creator (can be NULL). - - Returns: - str: NULL in the case of an error, or a newly allocated string containing the path. This string must be freed by OrthancPluginFreeString(). - """ - ... - -# Make a HTTP DELETE call to the given URL -def HttpDelete(url: str, username: str, password: str) -> None: - """ - Make a HTTP DELETE call to the given URL. Favor OrthancPluginRestApiDelete() if calling the built-in REST API of the Orthanc instance that hosts this plugin. - - Args: - url (str): The URL of interest. - username (str): The username (can be "NULL" if no password protection). - password (str): The password (can be "NULL" if no password protection). - """ - ... - -# Make a HTTP GET call to the given URL -def HttpGet(url: str, username: str, password: str) -> bytes: - """ - Make a HTTP GET call to the given URL. The result to the query is stored into a newly allocated memory buffer. Favor OrthancPluginRestApiGet() if calling the built-in REST API of the Orthanc instance that hosts this plugin. - - Args: - url (str): The URL of interest. - username (str): The username (can be "NULL" if no password protection). - password (str): The password (can be "NULL" if no password protection). - - Returns: - bytes: 0 if success, or the error code if failure. - """ - ... - -# Make a HTTP POST call to the given URL -def HttpPost(url: str, body: bytes, username: str, password: str) -> bytes: - """ - Make a HTTP POST call to the given URL. The result to the query is stored into a newly allocated memory buffer. Favor OrthancPluginRestApiPost() if calling the built-in REST API of the Orthanc instance that hosts this plugin. - - Args: - url (str): The URL of interest. - body (bytes): The content of the body of the request. - username (str): The username (can be "NULL" if no password protection). - password (str): The password (can be "NULL" if no password protection). - - Returns: - bytes: 0 if success, or the error code if failure. - """ - ... - -# Make a HTTP PUT call to the given URL -def HttpPut(url: str, body: bytes, username: str, password: str) -> bytes: - """ - Make a HTTP PUT call to the given URL. The result to the query is stored into a newly allocated memory buffer. Favor OrthancPluginRestApiPut() if calling the built-in REST API of the Orthanc instance that hosts this plugin. - - Args: - url (str): The URL of interest. - body (bytes): The content of the body of the request. - username (str): The username (can be "NULL" if no password protection). - password (str): The password (can be "NULL" if no password protection). - - Returns: - bytes: 0 if success, or the error code if failure. - """ - ... - -# This function loads a DICOM instance from the content of the Orthanc database -def LoadDicomInstance(instance_id: str, mode: LoadDicomInstanceMode) -> DicomInstance: - """ - This function loads a DICOM instance from the content of the Orthanc database. The function returns a new pointer to a data structure that is managed by the Orthanc core. - - Args: - instance_id (str): The Orthanc identifier of the DICOM instance of interest. - mode (LoadDicomInstanceMode): Flag specifying how to deal with pixel data. - - Returns: - DicomInstance: The newly allocated DICOM instance. It must be freed with OrthancPluginFreeDicomInstance(). - """ - ... - -# Log an error message using the Orthanc logging system -def LogError(message: str) -> None: - """ - Log an error message using the Orthanc logging system. - - Args: - message (str): The message to be logged. - """ - ... - -# Log an information message using the Orthanc logging system -def LogInfo(message: str) -> None: - """ - Log an information message using the Orthanc logging system. - - Args: - message (str): The message to be logged. - """ - ... - -# Log a message using the Orthanc logging system -def LogMessage(message: str, plugin: str, file: str, line: int, category: LogCategory, level: LogLevel) -> None: - """ - Log a message using the Orthanc logging system. - - Args: - message (str): The message to be logged. - plugin (str): The plugin name. - file (str): The filename in the plugin code. - line (int): The file line in the plugin code. - category (LogCategory): The category. - level (LogLevel): The level of the message. - """ - ... - -# Log a warning message using the Orthanc logging system -def LogWarning(message: str) -> None: - """ - Log a warning message using the Orthanc logging system. - - Args: - message (str): The message to be logged. - """ - ... - -# Look for an instance stored in Orthanc, using its SOP Instance UID tag (0x0008, 0x0018) -def LookupInstance(sop_instance_u_i_d: str) -> str: - """ - Look for an instance stored in Orthanc, using its SOP Instance UID tag (0x0008, 0x0018). This function uses the database index to run as fast as possible (it does not loop over all the stored instances). - - Args: - sop_instance_u_i_d (str): The SOP Instance UID of interest. - - Returns: - str: The NULL value if the instance is non-existent, or a string containing the Orthanc ID of the instance. This string must be freed by OrthancPluginFreeString(). - """ - ... - -# Look for a patient stored in Orthanc, using its Patient ID tag (0x0010, 0x0020) -def LookupPatient(patient_i_d: str) -> str: - """ - Look for a patient stored in Orthanc, using its Patient ID tag (0x0010, 0x0020). This function uses the database index to run as fast as possible (it does not loop over all the stored patients). - - Args: - patient_i_d (str): The Patient ID of interest. - - Returns: - str: The NULL value if the patient is non-existent, or a string containing the Orthanc ID of the patient. This string must be freed by OrthancPluginFreeString(). - """ - ... - -# Look for a series stored in Orthanc, using its Series Instance UID tag (0x0020, 0x000e) -def LookupSeries(series_u_i_d: str) -> str: - """ - Look for a series stored in Orthanc, using its Series Instance UID tag (0x0020, 0x000e). This function uses the database index to run as fast as possible (it does not loop over all the stored series). - - Args: - series_u_i_d (str): The Series Instance UID of interest. - - Returns: - str: The NULL value if the series is non-existent, or a string containing the Orthanc ID of the series. This string must be freed by OrthancPluginFreeString(). - """ - ... - -# Look for a study stored in Orthanc, using its Study Instance UID tag (0x0020, 0x000d) -def LookupStudy(study_u_i_d: str) -> str: - """ - Look for a study stored in Orthanc, using its Study Instance UID tag (0x0020, 0x000d). This function uses the database index to run as fast as possible (it does not loop over all the stored studies). - - Args: - study_u_i_d (str): The Study Instance UID of interest. - - Returns: - str: The NULL value if the study is non-existent, or a string containing the Orthanc ID of the study. This string must be freed by OrthancPluginFreeString(). - """ - ... - -# Look for a study stored in Orthanc, using its Accession Number tag (0x0008, 0x0050) -def LookupStudyWithAccessionNumber(accession_number: str) -> str: - """ - Look for a study stored in Orthanc, using its Accession Number tag (0x0008, 0x0050). This function uses the database index to run as fast as possible (it does not loop over all the stored studies). - - Args: - accession_number (str): The Accession Number of interest. - - Returns: - str: The NULL value if the study is non-existent, or a string containing the Orthanc ID of the study. This string must be freed by OrthancPluginFreeString(). - """ - ... - -# Read the content of a file on the filesystem, and returns it into a newly allocated memory buffer -def ReadFile(path: str) -> bytes: - """ - Read the content of a file on the filesystem, and returns it into a newly allocated memory buffer. - - Args: - path (str): The path of the file to be read. - - Returns: - bytes: 0 if success, or the error code if failure. - """ - ... - -# This function declares a new public tag in the dictionary of DICOM tags that are known to Orthanc -def RegisterDictionaryTag(group: int, element: int, vr: ValueRepresentation, name: str, min_multiplicity: int, max_multiplicity: int) -> None: - """ - This function declares a new public tag in the dictionary of DICOM tags that are known to Orthanc. This function should be used in the OrthancPluginInitialize() callback. - - Args: - group (int): The group of the tag. - element (int): The element of the tag. - vr (ValueRepresentation): The value representation of the tag. - name (str): The nickname of the tag. - min_multiplicity (int): The minimum multiplicity of the tag (must be above 0). - max_multiplicity (int): The maximum multiplicity of the tag. A value of 0 means an arbitrary multiplicity (""n""). - """ - ... - -# This function declares a custom error code that can be generated by this plugin -def RegisterErrorCode(code: int, http_status: int, message: str) -> None: - """ - This function declares a custom error code that can be generated by this plugin. This declaration is used to enrich the body of the HTTP answer in the case of an error, and to set the proper HTTP status code. - - Args: - code (int): The error code that is internal to this plugin. - http_status (int): The HTTP status corresponding to this error. - message (str): The description of the error. - """ - ... - -# This function declares a new private tag in the dictionary of DICOM tags that are known to Orthanc -def RegisterPrivateDictionaryTag(group: int, element: int, vr: ValueRepresentation, name: str, min_multiplicity: int, max_multiplicity: int, private_creator: str) -> None: - """ - This function declares a new private tag in the dictionary of DICOM tags that are known to Orthanc. This function should be used in the OrthancPluginInitialize() callback. - - Args: - group (int): The group of the tag. - element (int): The element of the tag. - vr (ValueRepresentation): The value representation of the tag. - name (str): The nickname of the tag. - min_multiplicity (int): The minimum multiplicity of the tag (must be above 0). - max_multiplicity (int): The maximum multiplicity of the tag. A value of 0 means an arbitrary multiplicity (""n""). - private_creator (str): The private creator of this private tag. - """ - ... - -# Make a DELETE call to the built-in Orthanc REST API -def RestApiDelete(uri: str) -> None: - """ - Make a DELETE call to the built-in Orthanc REST API. - Remark: If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource. - - Args: - uri (str): The URI to delete in the built-in Orthanc API. - """ - ... - -# Make a DELETE call to the Orthanc REST API, after all the plugins are applied -def RestApiDeleteAfterPlugins(uri: str) -> None: - """ - Make a DELETE call to the Orthanc REST API, after all the plugins are applied. In other words, if some plugin overrides or adds the called URI to the built-in Orthanc REST API, this call will return the result provided by this plugin. - Remark: If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource. - - Args: - uri (str): The URI to delete in the built-in Orthanc API. - """ - ... - -# Make a GET call to the built-in Orthanc REST API -def RestApiGet(uri: str) -> bytes: - """ - Make a GET call to the built-in Orthanc REST API. The result to the query is stored into a newly allocated memory buffer. - Remark: If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource. - - Args: - uri (str): The URI in the built-in Orthanc API. - - Returns: - bytes: 0 if success, or the error code if failure. - """ - ... - -# Make a GET call to the Orthanc REST API, after all the plugins are applied -def RestApiGetAfterPlugins(uri: str) -> bytes: - """ - Make a GET call to the Orthanc REST API, after all the plugins are applied. In other words, if some plugin overrides or adds the called URI to the built-in Orthanc REST API, this call will return the result provided by this plugin. The result to the query is stored into a newly allocated memory buffer. - Remark: If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource. - - Args: - uri (str): The URI in the built-in Orthanc API. - - Returns: - bytes: 0 if success, or the error code if failure. - """ - ... - -# Make a POST call to the built-in Orthanc REST API -def RestApiPost(uri: str, body: bytes) -> bytes: - """ - Make a POST call to the built-in Orthanc REST API. The result to the query is stored into a newly allocated memory buffer. - Remark: If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource. - - Args: - uri (str): The URI in the built-in Orthanc API. - body (bytes): The body of the POST request. - - Returns: - bytes: 0 if success, or the error code if failure. - """ - ... - -# Make a POST call to the Orthanc REST API, after all the plugins are applied -def RestApiPostAfterPlugins(uri: str, body: bytes) -> bytes: - """ - Make a POST call to the Orthanc REST API, after all the plugins are applied. In other words, if some plugin overrides or adds the called URI to the built-in Orthanc REST API, this call will return the result provided by this plugin. The result to the query is stored into a newly allocated memory buffer. - Remark: If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource. - - Args: - uri (str): The URI in the built-in Orthanc API. - body (bytes): The body of the POST request. - - Returns: - bytes: 0 if success, or the error code if failure. - """ - ... - -# Make a PUT call to the built-in Orthanc REST API -def RestApiPut(uri: str, body: bytes) -> bytes: - """ - Make a PUT call to the built-in Orthanc REST API. The result to the query is stored into a newly allocated memory buffer. - Remark: If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource. - - Args: - uri (str): The URI in the built-in Orthanc API. - body (bytes): The body of the PUT request. - - Returns: - bytes: 0 if success, or the error code if failure. - """ - ... - -# Make a PUT call to the Orthanc REST API, after all the plugins are applied -def RestApiPutAfterPlugins(uri: str, body: bytes) -> bytes: - """ - Make a PUT call to the Orthanc REST API, after all the plugins are applied. In other words, if some plugin overrides or adds the called URI to the built-in Orthanc REST API, this call will return the result provided by this plugin. The result to the query is stored into a newly allocated memory buffer. - Remark: If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource. - - Args: - uri (str): The URI in the built-in Orthanc API. - body (bytes): The body of the PUT request. - - Returns: - bytes: 0 if success, or the error code if failure. - """ - ... - -# This function gives a name to the thread that is calling this function -def SetCurrentThreadName(thread_name: str) -> None: - """ - This function gives a name to the thread that is calling this function. This name is used in the Orthanc logs. This function must only be called from threads that the plugin has created itself. - - Args: - thread_name (str): The name of the current thread. A thread name cannot be longer than 16 characters. - """ - ... - -# Set a description for this plugin -def SetDescription(description: str) -> None: - """ - Set a description for this plugin. It is displayed in the "Plugins" page of Orthanc Explorer. - - Args: - description (str): The description. - """ - ... - -# Set a description for this plugin -def SetDescription2(plugin: str, description: str) -> None: - """ - Set a description for this plugin. It is displayed in the "Plugins" page of Orthanc Explorer. - - Args: - plugin (str): Identifier of your plugin (it must match "OrthancPluginGetName()"). - description (str): The description. - """ - ... - -# Set the value of a global property into the Orthanc database -def SetGlobalProperty(property: int, value: str) -> None: - """ - Set the value of a global property into the Orthanc database. Setting a global property can be used by plugins to save their internal parameters. Plugins are only allowed to set properties whose index are above or equal to 1024 (properties below 1024 are read-only and reserved by Orthanc). - - Args: - property (int): The global property of interest. - value (str): The value to be set in the global property. - """ - ... - -# This function sets the value of a floating-point metrics to monitor the behavior of the plugin through tools such as Prometheus -def SetMetricsValue(name: str, value: float, type: MetricsType) -> None: - """ - This function sets the value of a floating-point metrics to monitor the behavior of the plugin through tools such as Prometheus. The values of all the metrics are stored within the Orthanc context. - - Args: - name (str): The name of the metrics to be set. - value (float): The value of the metrics. - type (MetricsType): The type of the metrics. This parameter is only taken into consideration the first time this metrics is set. - """ - ... - -# For plugins that come with a Web interface, this function declares the entry path where to find this interface -def SetRootUri(uri: str) -> None: - """ - For plugins that come with a Web interface, this function declares the entry path where to find this interface. This information is notably used in the "Plugins" page of Orthanc Explorer. - - Args: - uri (str): The root URI for this plugin. - """ - ... - -# For plugins that come with a Web interface, this function declares the entry path where to find this interface -def SetRootUri2(plugin: str, uri: str) -> None: - """ - For plugins that come with a Web interface, this function declares the entry path where to find this interface. This information is notably used in the "Plugins" page of Orthanc Explorer. - - Args: - plugin (str): Identifier of your plugin (it must match "OrthancPluginGetName()"). - uri (str): The root URI for this plugin. - """ - ... - -# This function parses a memory buffer that contains a DICOM file, then transcodes it to the given transfer syntax -def TranscodeDicomInstance(buffer: bytes, transfer_syntax: str) -> DicomInstance: - """ - This function parses a memory buffer that contains a DICOM file, then transcodes it to the given transfer syntax. The function returns a new pointer to a data structure that is managed by the Orthanc core. - - Args: - buffer (bytes): The memory buffer containing the DICOM instance. - transfer_syntax (str): The transfer syntax UID for the transcoding. - - Returns: - DicomInstance: The newly allocated DICOM instance. It must be freed with OrthancPluginFreeDicomInstance(). - """ - ... - -# This function decodes a compressed image from a memory buffer -def UncompressImage(data: bytes, format: ImageFormat) -> Image: - """ - This function decodes a compressed image from a memory buffer. - - Args: - data (bytes): Pointer to a memory buffer containing the compressed image. - format (ImageFormat): The file format of the compressed image. - - Returns: - Image: The uncompressed image. It must be freed with OrthancPluginFreeImage(). - """ - ... - -# Write the content of a memory buffer to the filesystem -def WriteFile(path: str, data: bytes) -> None: - """ - Write the content of a memory buffer to the filesystem. - - Args: - path (str): The path of the file to be written. - data (bytes): The content of the memory buffer. - """ - ... - -# This function creates an image of given size and format, and initializes its pixel data from a memory buffer -def CreateImageFromBuffer(format: PixelFormat, width: int, height: int, pitch: int, buffer: bytes) -> Image: - """ - This function creates an image of given size and format, and initializes its pixel data from a memory buffer. - - Args: - format (PixelFormat): The format of the pixels. - width (int): The width of the image. - height (int): The height of the image. - pitch (int): The pitch of the image (i.e. the number of bytes between 2 successive lines of the image in the memory buffer). - buffer (bytes): The memory buffer. - - Returns: - Image: The newly allocated image. - """ - ... - -# Get information about the given DICOM tag -def LookupDictionary(name: str) -> dict: - """ - Get information about the given DICOM tag. - - Args: - name (str): The name of the DICOM tag. - - Returns: - dict: Dictionary containing the requested information. - """ - ... - -class FindCallback(typing.Protocol): - def __call__(self, answers: FindAnswers, query: FindQuery, issuer_aet: str, called_aet: str) -> None: - ... - -# Register a callback to handle C-Find requests -def RegisterFindCallback(callback: FindCallback) -> None: - """ - Register a callback to handle C-Find requests. - - Args: - callback (FindCallback): The callback function. - """ - ... - -class IncomingCStoreInstanceFilter(typing.Protocol): - def __call__(self, received_dicom: DicomInstance) -> int: - ... - -# Register a callback to filter incoming DICOM instances received by Orthanc through C-STORE -def RegisterIncomingCStoreInstanceFilter(callback: IncomingCStoreInstanceFilter) -> None: - """ - Register a callback to filter incoming DICOM instances received by Orthanc through C-STORE. - - Args: - callback (IncomingCStoreInstanceFilter): The callback function. - """ - ... - -class IncomingHttpRequestFilter(typing.Protocol): - def __call__(self, uri: str, method: HttpMethod, ip: str, headers: dict, get: dict) -> bool: - ... - -# Callback to filter incoming HTTP requests received by Orthanc -def RegisterIncomingHttpRequestFilter(callback: IncomingHttpRequestFilter) -> None: - """ - Callback to filter incoming HTTP requests received by Orthanc. - - Args: - callback (IncomingHttpRequestFilter): The callback function. - """ - ... - -class MoveCallback(typing.Protocol): - def __call__(self, Level: str, PatientID: str, AccessionNumber: str, StudyInstanceUID: str, SeriesInstanceUID: str, SOPInstanceUID: str, OriginatorAET: str, SourceAET: str, TargetAET: str, OriginatorID: int) -> None: - ... - -# Register a callback to handle C-Move requests (simple version, with 1 suboperation) -def RegisterMoveCallback(callback: MoveCallback) -> None: - """ - Register a callback to handle C-Move requests (simple version, with 1 suboperation). - - Args: - callback (MoveCallback): The callback function. - """ - ... - -class MoveCallback2(typing.Protocol): - def __call__(self, Level: str, PatientID: str, AccessionNumber: str, StudyInstanceUID: str, SeriesInstanceUID: str, SOPInstanceUID: str, OriginatorAET: str, SourceAET: str, TargetAET: str, OriginatorID: int) -> object: - ... - -class GetMoveSizeCallback(typing.Protocol): - def __call__(self, driver: object) -> int: - ... - -class ApplyMoveCallback(typing.Protocol): - def __call__(self, driver: object) -> None: - ... - -class FreeMoveCallback(typing.Protocol): - def __call__(self, driver: object) -> None: - ... - -# Register a callback to handle C-Move requests (full version, with multiple suboperations) -def RegisterMoveCallback2(callback: MoveCallback2, get_move_size: GetMoveSizeCallback, apply_move: ApplyMoveCallback, free_move: FreeMoveCallback) -> None: - """ - Register a callback to handle C-Move requests (full version, with multiple suboperations). - - Args: - callback (MoveCallback2): Main callback that creates the C-Move driver. - get_move_size (GetMoveSizeCallback): Callback to read the number of C-Move suboperations. - apply_move (ApplyMoveCallback): Callback to apply one C-Move suboperation. - free_move (FreeMoveCallback): Callback to free the C-Move driver. - """ - ... - -class OnChangeCallback(typing.Protocol): - def __call__(self, change_type: ChangeType, resource_type: ResourceType, resource_id: str) -> None: - ... - -# Register a callback to monitor changes -def RegisterOnChangeCallback(callback: OnChangeCallback) -> None: - """ - Register a callback to monitor changes. - - Args: - callback (OnChangeCallback): The callback function. - """ - ... - -class OnStoredInstanceCallback(typing.Protocol): - def __call__(self, instance: DicomInstance, instance_id: str) -> None: - ... - -# Register a callback for received DICOM instances -def RegisterOnStoredInstanceCallback(callback: OnStoredInstanceCallback) -> None: - """ - Register a callback for received DICOM instances. - - Args: - callback (OnStoredInstanceCallback): The callback function. - """ - ... - -class ReceivedInstanceCallback(typing.Protocol): - def __call__(self, received_dicom: bytes, origin: InstanceOrigin) -> tuple[ReceivedInstanceAction, bytes]: - ... - -# Register a callback to keep/discard/modify a DICOM instance received by Orthanc from any source (C-STORE or REST API) -def RegisterReceivedInstanceCallback(callback: ReceivedInstanceCallback) -> None: - """ - Register a callback to keep/discard/modify a DICOM instance received by Orthanc from any source (C-STORE or REST API). - - Args: - callback (ReceivedInstanceCallback): The callback function. - """ - ... - -class RestCallback(typing.Protocol): - def __call__(self, output: RestOutput, url: str, method: HttpMethod, groups: dict, get: dict, headers: dict, body: bytes=None) -> None: - ... - -# Register a REST callback -def RegisterRestCallback(path_regular_expression: str, callback: RestCallback) -> None: - """ - Register a REST callback. - - Args: - path_regular_expression (str): Regular expression for the URI. May contain groups. - callback (RestCallback): The callback function to handle the REST call. - """ - ... - -class StorageCreateCallback(typing.Protocol): - def __call__(self, uuid: str, content_type: ContentType, data: bytes) -> None: - ... - -class StorageReadCallback(typing.Protocol): - def __call__(self, uuid: str, content_type: ContentType) -> bytes: - ... - -class StorageRemoveCallback(typing.Protocol): - def __call__(self, uuid: str, content_type: ContentType) -> None: - ... - -# Register a custom storage area -def RegisterStorageArea(create: StorageCreateCallback, read: StorageReadCallback, remove: StorageRemoveCallback) -> None: - """ - Register a custom storage area. - - Args: - create (StorageCreateCallback): The callback function to store a file on the custom storage area. - read (StorageReadCallback): The callback function to read a file from the custom storage area. - remove (StorageRemoveCallback): The callback function to remove a file from the custom storage area. - """ - ... - -class StorageCommitmentScpCallback(typing.Protocol): - def __call__(self, job_id: str, transaction_uid: str, sop_class_uids: list[str], sop_instance_uids: list[str], remote_aet: str, called_aet: str) -> object: - ... - -class StorageCommitmentLookup(typing.Protocol): - def __call__(self, sop_class_uid: str, sop_instance_uid: str, driver: object) -> StorageCommitmentFailureReason: - ... - -# Register a callback to handle incoming requests to the storage commitment SCP -def RegisterStorageCommitmentScpCallback(callback: StorageCommitmentScpCallback, lookup: StorageCommitmentLookup) -> None: - """ - Register a callback to handle incoming requests to the storage commitment SCP. - - Args: - callback (StorageCommitmentScpCallback): Main callback that creates the a driver to handle an incoming storage commitment request. - lookup (StorageCommitmentLookup): Callback function to get the status of one DICOM instance. - """ - ... - -class WorklistCallback(typing.Protocol): - def __call__(self, answers: WorklistAnswers, query: WorklistQuery, issuer_aet: str, called_aet: str) -> None: - ... - -# Register a callback to handle modality worklists requests -def RegisterWorklistCallback(callback: WorklistCallback) -> None: - """ - Register a callback to handle modality worklists requests. - - Args: - callback (WorklistCallback): The callback function. - """ - ... - - -class DicomInstance: - """ - DICOM instance managed by the Orthanc core - """ - ... - - - # This function returns the Application Entity Title (AET) of the DICOM modality from which a DICOM instance originates - def GetInstanceRemoteAet(self) -> str: - """ - This function returns the Application Entity Title (AET) of the DICOM modality from which a DICOM instance originates. - - Returns: - str: The AET if success, NULL if error. - """ - ... - - # This function returns the number of bytes of the given DICOM instance - def GetInstanceSize(self) -> int: - """ - This function returns the number of bytes of the given DICOM instance. - - Returns: - int: The size of the file, -1 in case of error. - """ - ... - - # This function returns a pointer to a newly created string containing a JSON file - def GetInstanceJson(self) -> str: - """ - This function returns a pointer to a newly created string containing a JSON file. This JSON file encodes the tag hierarchy of the given DICOM instance. - - Returns: - str: The NULL value in case of error, or a string containing the JSON file. This string must be freed by OrthancPluginFreeString(). - """ - ... - - # This function returns a pointer to a newly created string containing a JSON file - def GetInstanceSimplifiedJson(self) -> str: - """ - This function returns a pointer to a newly created string containing a JSON file. This JSON file encodes the tag hierarchy of the given DICOM instance. In contrast with ::OrthancPluginGetInstanceJson(), the returned JSON file is in its simplified version. - - Returns: - str: The NULL value in case of error, or a string containing the JSON file. This string must be freed by OrthancPluginFreeString(). - """ - ... - - # This function checks whether the DICOM instance of interest is associated with some metadata - def HasInstanceMetadata(self, metadata: str) -> int: - """ - This function checks whether the DICOM instance of interest is associated with some metadata. As of Orthanc 0.8.1, in the callbacks registered by ::OrthancPluginRegisterOnStoredInstanceCallback(), the only possibly available metadata are "ReceptionDate", "RemoteAET" and "IndexInSeries". - - Args: - metadata (str): The metadata of interest. - - Returns: - int: 1 if the metadata is present, 0 if it is absent, -1 in case of error. - """ - ... - - # This functions returns the value of some metadata that is associated with the DICOM instance of interest - def GetInstanceMetadata(self, metadata: str) -> str: - """ - This functions returns the value of some metadata that is associated with the DICOM instance of interest. Before calling this function, the existence of the metadata must have been checked with ::OrthancPluginHasInstanceMetadata(). - - Args: - metadata (str): The metadata of interest. - - Returns: - str: The metadata value if success, NULL if error. Please note that the returned string belongs to the instance object and must NOT be deallocated. Please make a copy of the string if you wish to access it later. - """ - ... - - # This function returns the origin of a DICOM instance that has been received by Orthanc - def GetInstanceOrigin(self) -> InstanceOrigin: - """ - This function returns the origin of a DICOM instance that has been received by Orthanc. - - Returns: - InstanceOrigin: The origin of the instance. - """ - ... - - # This function returns a pointer to a newly created string that contains the transfer syntax UID of the DICOM instance - def GetInstanceTransferSyntaxUid(self) -> str: - """ - This function returns a pointer to a newly created string that contains the transfer syntax UID of the DICOM instance. The empty string might be returned if this information is unknown. - - Returns: - str: The NULL value in case of error, or a string containing the transfer syntax UID. This string must be freed by OrthancPluginFreeString(). - """ - ... - - # This function returns a Boolean value indicating whether the DICOM instance contains the pixel data (7FE0,0010) tag - def HasInstancePixelData(self) -> int: - """ - This function returns a Boolean value indicating whether the DICOM instance contains the pixel data (7FE0,0010) tag. - - Returns: - int: "1" if the DICOM instance contains pixel data, or "0" if the tag is missing, or "-1" in the case of an error. - """ - ... - - # This function returns the number of frames that are part of a DICOM image managed by the Orthanc core - def GetInstanceFramesCount(self) -> int: - """ - This function returns the number of frames that are part of a DICOM image managed by the Orthanc core. - - Returns: - int: The number of frames (will be zero in the case of an error). - """ - ... - - # This function returns a memory buffer containing the raw content of a frame in a DICOM instance that is managed by the Orthanc core - def GetInstanceRawFrame(self, frame_index: int) -> bytes: - """ - This function returns a memory buffer containing the raw content of a frame in a DICOM instance that is managed by the Orthanc core. This is notably useful for compressed transfer syntaxes, as it gives access to the embedded files (such as JPEG, JPEG-LS or JPEG2k). The Orthanc core transparently reassembles the fragments to extract the raw frame. - - Args: - frame_index (int): The index of the frame of interest. - - Returns: - bytes: 0 if success, or the error code if failure. - """ - ... - - # This function decodes one frame of a DICOM image that is managed by the Orthanc core - def GetInstanceDecodedFrame(self, frame_index: int) -> Image: - """ - This function decodes one frame of a DICOM image that is managed by the Orthanc core. - - Args: - frame_index (int): The index of the frame of interest. - - Returns: - Image: The uncompressed image. It must be freed with OrthancPluginFreeImage(). - """ - ... - - # This function returns a memory buffer containing the serialization of a DICOM instance that is managed by the Orthanc core - def SerializeDicomInstance(self) -> bytes: - """ - This function returns a memory buffer containing the serialization of a DICOM instance that is managed by the Orthanc core. - - Returns: - bytes: 0 if success, or the error code if failure. - """ - ... - - # This function takes as DICOM instance managed by the Orthanc core, and outputs a JSON string representing the tags of this DICOM file - def GetInstanceAdvancedJson(self, format: DicomToJsonFormat, flags: DicomToJsonFlags, max_string_length: int) -> str: - """ - This function takes as DICOM instance managed by the Orthanc core, and outputs a JSON string representing the tags of this DICOM file. - - Args: - format (DicomToJsonFormat): The output format. - flags (DicomToJsonFlags): Flags governing the output. - max_string_length (int): The maximum length of a field. Too long fields will be output as "null". The 0 value means no maximum length. - - Returns: - str: The NULL value if the case of an error, or the JSON string. This string must be freed by OrthancPluginFreeString(). - """ - ... - - - # Get the content of the DICOM instance - def GetInstanceData(self) -> bytes: - """ - Get the content of the DICOM instance. - - Returns: - bytes: The DICOM data. - """ - ... -class DicomWebNode: - """ - Node visited by DICOMweb conversion - """ - ... - - -class FindAnswers: - """ - Answers to a DICOM C-FIND query - """ - ... - - - # This function adds one answer (encoded as a DICOM file) to the set of answers corresponding to some C-Find SCP request that is not related to modality worklists - def FindAddAnswer(self, dicom: bytes) -> None: - """ - This function adds one answer (encoded as a DICOM file) to the set of answers corresponding to some C-Find SCP request that is not related to modality worklists. - - Args: - dicom (bytes): The answer to be added, encoded as a DICOM file. - """ - ... - - # This function marks as incomplete the set of answers corresponding to some C-Find SCP request that is not related to modality worklists - def FindMarkIncomplete(self) -> None: - """ - This function marks as incomplete the set of answers corresponding to some C-Find SCP request that is not related to modality worklists. This must be used if canceling the handling of a request when too many answers are to be returned. - """ - ... - -class FindMatcher: - """ - Matcher for DICOM C-FIND query - """ - ... - - - # This function checks whether one DICOM instance matches C-Find matcher that was previously allocated using OrthancPluginCreateFindMatcher() - def FindMatcherIsMatch(self, dicom: bytes) -> int: - """ - This function checks whether one DICOM instance matches C-Find matcher that was previously allocated using OrthancPluginCreateFindMatcher(). - - Args: - dicom (bytes): The DICOM instance to be matched. - - Returns: - int: 1 if the DICOM instance matches the query, 0 otherwise. - """ - ... - -class FindQuery: - """ - DICOM C-FIND query - """ - ... - - - # This function returns the number of tags that are contained in the given C-Find query - def GetFindQuerySize(self) -> int: - """ - This function returns the number of tags that are contained in the given C-Find query. - - Returns: - int: The number of tags. - """ - ... - - # This function returns the symbolic name of one DICOM tag in the given C-Find query - def GetFindQueryTagName(self, index: int) -> str: - """ - This function returns the symbolic name of one DICOM tag in the given C-Find query. - - Args: - index (int): The index of the tag of interest. - - Returns: - str: 0 if success, other value if error. - """ - ... - - # This function returns the value associated with one tag in the given C-Find query - def GetFindQueryValue(self, index: int) -> str: - """ - This function returns the value associated with one tag in the given C-Find query. - - Args: - index (int): The index of the tag of interest. - - Returns: - str: 0 if success, other value if error. - """ - ... - - - # This function returns the element of one DICOM tag in the given C-Find query - def GetFindQueryTagElement(self, index: int) -> int: - """ - This function returns the element of one DICOM tag in the given C-Find query. - - Args: - index (int): The index of the tag of interest. - - Returns: - int: The value of the element. - """ - ... - - # This function returns the group of one DICOM tag in the given C-Find query - def GetFindQueryTagGroup(self, index: int) -> int: - """ - This function returns the group of one DICOM tag in the given C-Find query. - - Args: - index (int): The index of the tag of interest. - - Returns: - int: The value of the group. - """ - ... -class Image: - """ - 2D image managed by the Orthanc core - """ - ... - - - # This function returns the type of memory layout for the pixels of the given image - def GetImagePixelFormat(self) -> PixelFormat: - """ - This function returns the type of memory layout for the pixels of the given image. - - Returns: - PixelFormat: The pixel format. - """ - ... - - # This function returns the width of the given image - def GetImageWidth(self) -> int: - """ - This function returns the width of the given image. - - Returns: - int: The width. - """ - ... - - # This function returns the height of the given image - def GetImageHeight(self) -> int: - """ - This function returns the height of the given image. - - Returns: - int: The height. - """ - ... - - # This function returns the pitch of the given image - def GetImagePitch(self) -> int: - """ - This function returns the pitch of the given image. The pitch is defined as the number of bytes between 2 successive lines of the image in the memory buffer. - - Returns: - int: The pitch. - """ - ... - - # This function creates a new image, changing the memory layout of the pixels - def ConvertPixelFormat(self, target_format: PixelFormat) -> Image: - """ - This function creates a new image, changing the memory layout of the pixels. - - Args: - target_format (PixelFormat): The target pixel format. - - Returns: - Image: The resulting image. It must be freed with OrthancPluginFreeImage(). - """ - ... - - # This function draws some text on some image - def DrawText(self, font_index: int, utf8_text: str, x: int, y: int, r: int, g: int, b: int) -> None: - """ - This function draws some text on some image. - - Args: - font_index (int): The index of the font. This value must be less than OrthancPluginGetFontsCount(). - utf8_text (str): The text to be drawn, encoded as an UTF-8 zero-terminated string. - x (int): The X position of the text over the image. - y (int): The Y position of the text over the image. - r (int): The value of the red color channel of the text. - g (int): The value of the green color channel of the text. - b (int): The value of the blue color channel of the text. - """ - ... - - - # This function returns a pointer to the memory buffer that contains the pixels of the image - def GetImageBuffer(self) -> bytes: - """ - This function returns a pointer to the memory buffer that contains the pixels of the image. - - Returns: - bytes: The pixel data. - """ - ... -class Job: - """ - Orthanc job - """ - ... - - - # This function adds the given job to the pending jobs of Orthanc - def SubmitJob(self, priority: int) -> str: - """ - This function adds the given job to the pending jobs of Orthanc. Orthanc will take take of freeing it by invoking the finalization callback provided to OrthancPluginCreateJob(). - - Args: - priority (int): The priority of the job. - - Returns: - str: ID of the newly-submitted job. This string must be freed by OrthancPluginFreeString(). - """ - ... - -class Peers: - """ - Orthanc peer - """ - ... - - - # This function returns the number of Orthanc peers - def GetPeersCount(self) -> int: - """ - This function returns the number of Orthanc peers. - This function is thread-safe: Several threads sharing the same OrthancPluginPeers object can simultaneously call this function. - - Returns: - int: The number of peers. - """ - ... - - # This function returns the symbolic name of the Orthanc peer, which corresponds to the key of the "OrthancPeers" configuration option of Orthanc - def GetPeerName(self, peer_index: int) -> str: - """ - This function returns the symbolic name of the Orthanc peer, which corresponds to the key of the "OrthancPeers" configuration option of Orthanc. - This function is thread-safe: Several threads sharing the same OrthancPluginPeers object can simultaneously call this function. - - Args: - peer_index (int): The index of the peer of interest. This value must be lower than OrthancPluginGetPeersCount(). - - Returns: - str: The symbolic name, or NULL in the case of an error. - """ - ... - - # This function returns the base URL to the REST API of some Orthanc peer - def GetPeerUrl(self, peer_index: int) -> str: - """ - This function returns the base URL to the REST API of some Orthanc peer. - This function is thread-safe: Several threads sharing the same OrthancPluginPeers object can simultaneously call this function. - - Args: - peer_index (int): The index of the peer of interest. This value must be lower than OrthancPluginGetPeersCount(). - - Returns: - str: The URL, or NULL in the case of an error. - """ - ... - - # This function returns some user-defined property of some Orthanc peer - def GetPeerUserProperty(self, peer_index: int, user_property: str) -> str: - """ - This function returns some user-defined property of some Orthanc peer. An user-defined property is a property that is associated with the peer in the Orthanc configuration file, but that is not recognized by the Orthanc core. - This function is thread-safe: Several threads sharing the same OrthancPluginPeers object can simultaneously call this function. - - Args: - peer_index (int): The index of the peer of interest. This value must be lower than OrthancPluginGetPeersCount(). - user_property (str): The user property of interest. - - Returns: - str: The value of the user property, or NULL if it is not defined. - """ - ... - -class RestOutput: - """ - Output for a call to the REST API of Orthanc - """ - ... - - - # This function answers to a REST request with the content of a memory buffer - def AnswerBuffer(self, answer: bytes, mime_type: str) -> None: - """ - This function answers to a REST request with the content of a memory buffer. - - Args: - answer (bytes): Pointer to the memory buffer containing the answer. - mime_type (str): The MIME type of the answer. - """ - ... - - # This function answers to a REST request with a PNG image - def CompressAndAnswerPngImage(self, format: PixelFormat, width: int, height: int, pitch: int, buffer: bytes) -> None: - """ - This function answers to a REST request with a PNG image. The parameters of this function describe a memory buffer that contains an uncompressed image. The image will be automatically compressed as a PNG image by the core system of Orthanc. - - Args: - format (PixelFormat): The memory layout of the uncompressed image. - width (int): The width of the image. - height (int): The height of the image. - pitch (int): The pitch of the image (i.e. the number of bytes between 2 successive lines of the image in the memory buffer). - buffer (bytes): The memory buffer containing the uncompressed image. - """ - ... - - # This function answers to a REST request by redirecting the user to another URI using HTTP status 301 - def Redirect(self, redirection: str) -> None: - """ - This function answers to a REST request by redirecting the user to another URI using HTTP status 301. - - Args: - redirection (str): Where to redirect. - """ - ... - - # This function answers to a REST request by sending a HTTP status code (such as "400 - Bad Request") - def SendHttpStatusCode(self, status: int) -> None: - """ - This function answers to a REST request by sending a HTTP status code (such as "400 - Bad Request"). Note that: - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer(). - Redirections (status 301) must use ::OrthancPluginRedirect(). - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized(). - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed(). - - Args: - status (int): The HTTP status code to be sent. - """ - ... - - # This function answers to a REST request by signaling that it is not authorized - def SendUnauthorized(self, realm: str) -> None: - """ - This function answers to a REST request by signaling that it is not authorized. - - Args: - realm (str): The realm for the authorization process. - """ - ... - - # This function answers to a REST request by signaling that the queried URI does not support this method - def SendMethodNotAllowed(self, allowed_methods: str) -> None: - """ - This function answers to a REST request by signaling that the queried URI does not support this method. - - Args: - allowed_methods (str): The allowed methods for this URI (e.g. "GET,POST" after a PUT or a POST request). - """ - ... - - # This function sets a cookie in the HTTP client - def SetCookie(self, cookie: str, value: str) -> None: - """ - This function sets a cookie in the HTTP client. - - Args: - cookie (str): The cookie to be set. - value (str): The value of the cookie. - """ - ... - - # This function sets a HTTP header in the HTTP answer - def SetHttpHeader(self, key: str, value: str) -> None: - """ - This function sets a HTTP header in the HTTP answer. - - Args: - key (str): The HTTP header to be set. - value (str): The value of the HTTP header. - """ - ... - - # Initiates a HTTP multipart answer, as the result of a REST request - def StartMultipartAnswer(self, sub_type: str, content_type: str) -> None: - """ - Initiates a HTTP multipart answer, as the result of a REST request. - - Args: - sub_type (str): The sub-type of the multipart answer ("mixed" or "related"). - content_type (str): The MIME type of the items in the multipart answer. - """ - ... - - # This function sends an item as a part of some HTTP multipart answer that was initiated by OrthancPluginStartMultipartAnswer() - def SendMultipartItem(self, answer: bytes) -> None: - """ - This function sends an item as a part of some HTTP multipart answer that was initiated by OrthancPluginStartMultipartAnswer(). - - Args: - answer (bytes): Pointer to the memory buffer containing the item. - """ - ... - - # This function answers to a HTTP request by sending a HTTP status code (such as "400 - Bad Request"), together with a body describing the error - def SendHttpStatus(self, status: int, body: bytes) -> None: - """ - This function answers to a HTTP request by sending a HTTP status code (such as "400 - Bad Request"), together with a body describing the error. The body will only be returned if the configuration option "HttpDescribeErrors" of Orthanc is set to "true". - Note that: - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer(). - Redirections (status 301) must use ::OrthancPluginRedirect(). - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized(). - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed(). - - Args: - status (int): The HTTP status code to be sent. - body (bytes): The body of the answer. - """ - ... - - # This function answers to a REST request with a JPEG image - def CompressAndAnswerJpegImage(self, format: PixelFormat, width: int, height: int, pitch: int, buffer: bytes, quality: int) -> None: - """ - This function answers to a REST request with a JPEG image. The parameters of this function describe a memory buffer that contains an uncompressed image. The image will be automatically compressed as a JPEG image by the core system of Orthanc. - - Args: - format (PixelFormat): The memory layout of the uncompressed image. - width (int): The width of the image. - height (int): The height of the image. - pitch (int): The pitch of the image (i.e. the number of bytes between 2 successive lines of the image in the memory buffer). - buffer (bytes): The memory buffer containing the uncompressed image. - quality (int): The quality of the JPEG encoding, between 1 (worst quality, best compression) and 100 (best quality, worst compression). - """ - ... - - # This function sets the detailed description associated with an HTTP error - def SetHttpErrorDetails(self, details: str, log: int) -> None: - """ - This function sets the detailed description associated with an HTTP error. This description will be displayed in the "Details" field of the JSON body of the HTTP answer. It is only taken into consideration if the REST callback returns an error code that is different from "OrthancPluginErrorCode_Success", and if the "HttpDescribeErrors" configuration option of Orthanc is set to "true". - - Args: - details (str): The details of the error message. - log (int): Whether to also write the detailed error to the Orthanc logs. - """ - ... - - # Initiates an HTTP stream answer, as the result of a REST request - def StartStreamAnswer(self, content_type: str) -> None: - """ - Initiates an HTTP stream answer, as the result of a REST request. - - Args: - content_type (str): The MIME type of the items in the stream answer. - """ - ... - - # This function sends a chunk as part of an HTTP stream answer that was initiated by OrthancPluginStartStreamAnswer() - def SendStreamChunk(self, answer: bytes) -> None: - """ - This function sends a chunk as part of an HTTP stream answer that was initiated by OrthancPluginStartStreamAnswer(). - - Args: - answer (bytes): Pointer to the memory buffer containing the item. - """ - ... - -class ServerChunkedRequestReader: - """ - Read for a chunked HTTP request - """ - ... - - -class StorageArea: - """ - Storage area plugin - """ - ... - - - # This function creates a new file inside the storage area that is currently used by Orthanc - def StorageAreaCreate(self, uuid: str, content: bytes, size: int, type: ContentType) -> None: - """ - This function creates a new file inside the storage area that is currently used by Orthanc. - Warning: This function will result in a "not implemented" error on versions of the Orthanc core above 1.12.6. - - Args: - uuid (str): The identifier of the file to be created. - content (bytes): The content to store in the newly created file. - size (int): The size of the content. - type (ContentType): The type of the file content. - """ - ... - - # This function reads the content of a given file from the storage area that is currently used by Orthanc - def StorageAreaRead(self, uuid: str, type: ContentType) -> bytes: - """ - This function reads the content of a given file from the storage area that is currently used by Orthanc. - Warning: This function will result in a "not implemented" error on versions of the Orthanc core above 1.12.6. - - Args: - uuid (str): The identifier of the file to be read. - type (ContentType): The type of the file content. - - Returns: - bytes: 0 if success, other value if error. - """ - ... - - # This function removes a given file from the storage area that is currently used by Orthanc - def StorageAreaRemove(self, uuid: str, type: ContentType) -> None: - """ - This function removes a given file from the storage area that is currently used by Orthanc. - Warning: This function will result in a "not implemented" error on versions of the Orthanc core above 1.12.6. - - Args: - uuid (str): The identifier of the file to be removed. - type (ContentType): The type of the file content. - """ - ... - - # This function requests the Orthanc core to reconstruct the main DICOM tags of all the resources of the given type - def ReconstructMainDicomTags(self, level: ResourceType) -> None: - """ - This function requests the Orthanc core to reconstruct the main DICOM tags of all the resources of the given type. This function can only be used as a part of the upgrade of a custom database back-end. A database transaction will be automatically setup. - - Args: - level (ResourceType): The type of the resources of interest. - """ - ... - -class WebDavCollection: - """ - WebDAV collection - """ - ... - - -class WorklistAnswers: - """ - Answers to a DICOM C-FIND worklist query - """ - ... - - - # This function adds one worklist (encoded as a DICOM file) to the set of answers corresponding to some C-Find SCP request against modality worklists - def WorklistAddAnswer(self, query: WorklistQuery, dicom: bytes) -> None: - """ - This function adds one worklist (encoded as a DICOM file) to the set of answers corresponding to some C-Find SCP request against modality worklists. - - Args: - query (WorklistQuery): The worklist query, as received by the callback. - dicom (bytes): The worklist to answer, encoded as a DICOM file. - """ - ... - - # This function marks as incomplete the set of answers corresponding to some C-Find SCP request against modality worklists - def WorklistMarkIncomplete(self) -> None: - """ - This function marks as incomplete the set of answers corresponding to some C-Find SCP request against modality worklists. This must be used if canceling the handling of a request when too many answers are to be returned. - """ - ... - -class WorklistQuery: - """ - DICOM C-FIND worklist query - """ - ... - - - # This function checks whether one worklist (encoded as a DICOM file) matches the C-Find SCP query against modality worklists - def WorklistIsMatch(self, dicom: bytes) -> int: - """ - This function checks whether one worklist (encoded as a DICOM file) matches the C-Find SCP query against modality worklists. This function must be called before adding the worklist as an answer through OrthancPluginWorklistAddAnswer(). - - Args: - dicom (bytes): The worklist to answer, encoded as a DICOM file. - - Returns: - int: 1 if the worklist matches the query, 0 otherwise. - """ - ... - - # This function retrieves the DICOM file that underlies a C-Find SCP query against modality worklists - def WorklistGetDicomQuery(self) -> bytes: - """ - This function retrieves the DICOM file that underlies a C-Find SCP query against modality worklists. - - Returns: - bytes: 0 if success, other value if error. - """ - ... -
--- a/Sources/Autogenerated/sdk.cpp Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,135 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -#include "sdk.h" - -#include "../PythonLock.h" -#include "../PythonThreadsAllower.h" - -#include "../../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h" - -#include "./sdk_OrthancPluginChangeType.impl.h" -#include "./sdk_OrthancPluginCompressionType.impl.h" -#include "./sdk_OrthancPluginConstraintType.impl.h" -#include "./sdk_OrthancPluginContentType.impl.h" -#include "./sdk_OrthancPluginCreateDicomFlags.impl.h" -#include "./sdk_OrthancPluginDicomToJsonFlags.impl.h" -#include "./sdk_OrthancPluginDicomToJsonFormat.impl.h" -#include "./sdk_OrthancPluginDicomWebBinaryMode.impl.h" -#include "./sdk_OrthancPluginErrorCode.impl.h" -#include "./sdk_OrthancPluginHttpMethod.impl.h" -#include "./sdk_OrthancPluginIdentifierConstraint.impl.h" -#include "./sdk_OrthancPluginImageFormat.impl.h" -#include "./sdk_OrthancPluginInstanceOrigin.impl.h" -#include "./sdk_OrthancPluginJobStepStatus.impl.h" -#include "./sdk_OrthancPluginJobStopReason.impl.h" -#include "./sdk_OrthancPluginLoadDicomInstanceMode.impl.h" -#include "./sdk_OrthancPluginLogCategory.impl.h" -#include "./sdk_OrthancPluginLogLevel.impl.h" -#include "./sdk_OrthancPluginMetricsType.impl.h" -#include "./sdk_OrthancPluginPixelFormat.impl.h" -#include "./sdk_OrthancPluginReceivedInstanceAction.impl.h" -#include "./sdk_OrthancPluginResourceType.impl.h" -#include "./sdk_OrthancPluginStorageCommitmentFailureReason.impl.h" -#include "./sdk_OrthancPluginValueRepresentation.impl.h" - -#include "./sdk_OrthancPluginDicomInstance.impl.h" -#include "./sdk_OrthancPluginDicomWebNode.impl.h" -#include "./sdk_OrthancPluginFindAnswers.impl.h" -#include "./sdk_OrthancPluginFindMatcher.impl.h" -#include "./sdk_OrthancPluginFindQuery.impl.h" -#include "./sdk_OrthancPluginImage.impl.h" -#include "./sdk_OrthancPluginJob.impl.h" -#include "./sdk_OrthancPluginPeers.impl.h" -#include "./sdk_OrthancPluginRestOutput.impl.h" -#include "./sdk_OrthancPluginServerChunkedRequestReader.impl.h" -#include "./sdk_OrthancPluginStorageArea.impl.h" -#include "./sdk_OrthancPluginWebDavCollection.impl.h" -#include "./sdk_OrthancPluginWorklistAnswers.impl.h" -#include "./sdk_OrthancPluginWorklistQuery.impl.h" - -#include "./sdk_GlobalFunctions.impl.h" - -#include "./sdk_OrthancPluginDicomInstance.methods.h" -#include "./sdk_OrthancPluginDicomWebNode.methods.h" -#include "./sdk_OrthancPluginFindAnswers.methods.h" -#include "./sdk_OrthancPluginFindMatcher.methods.h" -#include "./sdk_OrthancPluginFindQuery.methods.h" -#include "./sdk_OrthancPluginImage.methods.h" -#include "./sdk_OrthancPluginJob.methods.h" -#include "./sdk_OrthancPluginPeers.methods.h" -#include "./sdk_OrthancPluginRestOutput.methods.h" -#include "./sdk_OrthancPluginServerChunkedRequestReader.methods.h" -#include "./sdk_OrthancPluginStorageArea.methods.h" -#include "./sdk_OrthancPluginWebDavCollection.methods.h" -#include "./sdk_OrthancPluginWorklistAnswers.methods.h" -#include "./sdk_OrthancPluginWorklistQuery.methods.h" - -void RegisterOrthancSdk(PyObject* module) -{ - RegisterOrthancPluginChangeTypeEnumeration(module); - RegisterOrthancPluginCompressionTypeEnumeration(module); - RegisterOrthancPluginConstraintTypeEnumeration(module); - RegisterOrthancPluginContentTypeEnumeration(module); - RegisterOrthancPluginCreateDicomFlagsEnumeration(module); - RegisterOrthancPluginDicomToJsonFlagsEnumeration(module); - RegisterOrthancPluginDicomToJsonFormatEnumeration(module); - RegisterOrthancPluginDicomWebBinaryModeEnumeration(module); - RegisterOrthancPluginErrorCodeEnumeration(module); - RegisterOrthancPluginHttpMethodEnumeration(module); - RegisterOrthancPluginIdentifierConstraintEnumeration(module); - RegisterOrthancPluginImageFormatEnumeration(module); - RegisterOrthancPluginInstanceOriginEnumeration(module); - RegisterOrthancPluginJobStepStatusEnumeration(module); - RegisterOrthancPluginJobStopReasonEnumeration(module); - RegisterOrthancPluginLoadDicomInstanceModeEnumeration(module); - RegisterOrthancPluginLogCategoryEnumeration(module); - RegisterOrthancPluginLogLevelEnumeration(module); - RegisterOrthancPluginMetricsTypeEnumeration(module); - RegisterOrthancPluginPixelFormatEnumeration(module); - RegisterOrthancPluginReceivedInstanceActionEnumeration(module); - RegisterOrthancPluginResourceTypeEnumeration(module); - RegisterOrthancPluginStorageCommitmentFailureReasonEnumeration(module); - RegisterOrthancPluginValueRepresentationEnumeration(module); - - RegisterOrthancPluginDicomInstanceClass(module); - RegisterOrthancPluginDicomWebNodeClass(module); - RegisterOrthancPluginFindAnswersClass(module); - RegisterOrthancPluginFindMatcherClass(module); - RegisterOrthancPluginFindQueryClass(module); - RegisterOrthancPluginImageClass(module); - RegisterOrthancPluginJobClass(module); - RegisterOrthancPluginPeersClass(module); - RegisterOrthancPluginRestOutputClass(module); - RegisterOrthancPluginServerChunkedRequestReaderClass(module); - RegisterOrthancPluginStorageAreaClass(module); - RegisterOrthancPluginWebDavCollectionClass(module); - RegisterOrthancPluginWorklistAnswersClass(module); - RegisterOrthancPluginWorklistQueryClass(module); -}
--- a/Sources/Autogenerated/sdk.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,179 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -#pragma once - -#include "../PythonHeaderWrapper.h" - -void RegisterOrthancSdk(PyObject* module); -PyMethodDef* GetOrthancSdkFunctions(); - -PyTypeObject* GetOrthancPluginDicomInstanceType(); -PyTypeObject* GetOrthancPluginDicomWebNodeType(); -PyTypeObject* GetOrthancPluginFindAnswersType(); -PyTypeObject* GetOrthancPluginFindMatcherType(); -PyTypeObject* GetOrthancPluginFindQueryType(); -PyTypeObject* GetOrthancPluginImageType(); -PyTypeObject* GetOrthancPluginJobType(); -PyTypeObject* GetOrthancPluginPeersType(); -PyTypeObject* GetOrthancPluginRestOutputType(); -PyTypeObject* GetOrthancPluginServerChunkedRequestReaderType(); -PyTypeObject* GetOrthancPluginStorageAreaType(); -PyTypeObject* GetOrthancPluginWebDavCollectionType(); -PyTypeObject* GetOrthancPluginWorklistAnswersType(); -PyTypeObject* GetOrthancPluginWorklistQueryType(); - -#include <orthanc/OrthancCPlugin.h> - -typedef struct -{ - PyObject_HEAD - - /* Type-specific fields go here. */ - OrthancPluginDicomInstance* object_; - bool borrowed_; -} sdk_OrthancPluginDicomInstance_Object; - -typedef struct -{ - PyObject_HEAD - - /* Type-specific fields go here. */ - OrthancPluginDicomWebNode* object_; - bool borrowed_; -} sdk_OrthancPluginDicomWebNode_Object; - -typedef struct -{ - PyObject_HEAD - - /* Type-specific fields go here. */ - OrthancPluginFindAnswers* object_; - bool borrowed_; -} sdk_OrthancPluginFindAnswers_Object; - -typedef struct -{ - PyObject_HEAD - - /* Type-specific fields go here. */ - OrthancPluginFindMatcher* object_; - bool borrowed_; -} sdk_OrthancPluginFindMatcher_Object; - -typedef struct -{ - PyObject_HEAD - - /* Type-specific fields go here. */ - OrthancPluginFindQuery* object_; - bool borrowed_; -} sdk_OrthancPluginFindQuery_Object; - -typedef struct -{ - PyObject_HEAD - - /* Type-specific fields go here. */ - OrthancPluginImage* object_; - bool borrowed_; -} sdk_OrthancPluginImage_Object; - -typedef struct -{ - PyObject_HEAD - - /* Type-specific fields go here. */ - OrthancPluginJob* object_; - bool borrowed_; -} sdk_OrthancPluginJob_Object; - -typedef struct -{ - PyObject_HEAD - - /* Type-specific fields go here. */ - OrthancPluginPeers* object_; - bool borrowed_; -} sdk_OrthancPluginPeers_Object; - -typedef struct -{ - PyObject_HEAD - - /* Type-specific fields go here. */ - OrthancPluginRestOutput* object_; - bool borrowed_; -} sdk_OrthancPluginRestOutput_Object; - -typedef struct -{ - PyObject_HEAD - - /* Type-specific fields go here. */ - OrthancPluginServerChunkedRequestReader* object_; - bool borrowed_; -} sdk_OrthancPluginServerChunkedRequestReader_Object; - -typedef struct -{ - PyObject_HEAD - - /* Type-specific fields go here. */ - OrthancPluginStorageArea* object_; - bool borrowed_; -} sdk_OrthancPluginStorageArea_Object; - -typedef struct -{ - PyObject_HEAD - - /* Type-specific fields go here. */ - OrthancPluginWebDavCollection* object_; - bool borrowed_; -} sdk_OrthancPluginWebDavCollection_Object; - -typedef struct -{ - PyObject_HEAD - - /* Type-specific fields go here. */ - OrthancPluginWorklistAnswers* object_; - bool borrowed_; -} sdk_OrthancPluginWorklistAnswers_Object; - -typedef struct -{ - PyObject_HEAD - - /* Type-specific fields go here. */ - OrthancPluginWorklistQuery* object_; - bool borrowed_; -} sdk_OrthancPluginWorklistQuery_Object; -
--- a/Sources/Autogenerated/sdk_GlobalFunctions.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2271 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Forward declaration of the custom global functions -extern PyObject *CreateImageFromBuffer(PyObject* module, PyObject *args); -extern PyObject *LookupDictionary(PyObject* module, PyObject *args); -extern PyObject *RegisterFindCallback(PyObject* module, PyObject *args); -extern PyObject *RegisterIncomingCStoreInstanceFilter(PyObject* module, PyObject *args); -extern PyObject *RegisterIncomingHttpRequestFilter(PyObject* module, PyObject *args); -extern PyObject *RegisterMoveCallback(PyObject* module, PyObject *args); -extern PyObject *RegisterMoveCallback2(PyObject* module, PyObject *args); -extern PyObject *RegisterOnChangeCallback(PyObject* module, PyObject *args); -extern PyObject *RegisterOnStoredInstanceCallback(PyObject* module, PyObject *args); -extern PyObject *RegisterReceivedInstanceCallback(PyObject* module, PyObject *args); -extern PyObject *RegisterRestCallback(PyObject* module, PyObject *args); -extern PyObject *RegisterStorageArea(PyObject* module, PyObject *args); -extern PyObject *RegisterStorageCommitmentScpCallback(PyObject* module, PyObject *args); -extern PyObject *RegisterWorklistCallback(PyObject* module, PyObject *args); -// End of forward declarations - - -static PyObject* sdk_OrthancPluginAutodetectMimeType(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginAutodetectMimeType()"); - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - const char* s; - { - PythonThreadsAllower allower; - s = OrthancPluginAutodetectMimeType(OrthancPlugins::GetGlobalContext(), arg0); - } - - if (s == NULL) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - return PyUnicode_FromString(s); - } -} - -static PyObject* sdk_OrthancPluginBufferCompression(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginBufferCompression()"); - - Py_buffer arg0; - long int arg2 = 0; - unsigned char arg3 = 0; - - if (!PyArg_ParseTuple(args, "z*lb", &arg0, &arg2, &arg3)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); - return NULL; - } - - OrthancPlugins::MemoryBuffer buffer; - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginBufferCompression(OrthancPlugins::GetGlobalContext(), *buffer, (arg0.len > 0 ? arg0.buf : NULL), (arg0.len > 0 ? arg0.len : 0), static_cast<OrthancPluginCompressionType>(arg2), arg3); - } - PyBuffer_Release(&arg0); - if (code == OrthancPluginErrorCode_Success) - { - return PyBytes_FromStringAndSize(reinterpret_cast<const char*>(buffer.GetData()), buffer.GetSize()); - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject* sdk_OrthancPluginCheckVersion(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginCheckVersion()"); - - - - long value; - { - PythonThreadsAllower allower; - value = OrthancPluginCheckVersion(OrthancPlugins::GetGlobalContext()); - } - - return PyLong_FromLong(value); -} - -static PyObject* sdk_OrthancPluginCheckVersionAdvanced(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginCheckVersionAdvanced()"); - - long int arg0 = 0; - long int arg1 = 0; - long int arg2 = 0; - - if (!PyArg_ParseTuple(args, "lll", &arg0, &arg1, &arg2)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); - return NULL; - } - - long value; - { - PythonThreadsAllower allower; - value = OrthancPluginCheckVersionAdvanced(OrthancPlugins::GetGlobalContext(), arg0, arg1, arg2); - } - - return PyLong_FromLong(value); -} - -static PyObject* sdk_OrthancPluginCompressJpegImage(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginCompressJpegImage()"); - - long int arg0 = 0; - unsigned long arg1 = 0; - unsigned long arg2 = 0; - unsigned long arg3 = 0; - Py_buffer arg4; - unsigned char arg5 = 0; - - if (!PyArg_ParseTuple(args, "lkkkz*b", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (6 arguments expected)"); - return NULL; - } - - OrthancPlugins::MemoryBuffer buffer; - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginCompressJpegImage(OrthancPlugins::GetGlobalContext(), *buffer, static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2, arg3, arg4.buf, arg5); - } - PyBuffer_Release(&arg4); - if (code == OrthancPluginErrorCode_Success) - { - return PyBytes_FromStringAndSize(reinterpret_cast<const char*>(buffer.GetData()), buffer.GetSize()); - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject* sdk_OrthancPluginCompressPngImage(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginCompressPngImage()"); - - long int arg0 = 0; - unsigned long arg1 = 0; - unsigned long arg2 = 0; - unsigned long arg3 = 0; - Py_buffer arg4; - - if (!PyArg_ParseTuple(args, "lkkkz*", &arg0, &arg1, &arg2, &arg3, &arg4)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (5 arguments expected)"); - return NULL; - } - - OrthancPlugins::MemoryBuffer buffer; - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginCompressPngImage(OrthancPlugins::GetGlobalContext(), *buffer, static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2, arg3, arg4.buf); - } - PyBuffer_Release(&arg4); - if (code == OrthancPluginErrorCode_Success) - { - return PyBytes_FromStringAndSize(reinterpret_cast<const char*>(buffer.GetData()), buffer.GetSize()); - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject* sdk_OrthancPluginComputeMd5(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginComputeMd5()"); - - Py_buffer arg0; - - if (!PyArg_ParseTuple(args, "z*", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - OrthancPlugins::OrthancString s; - { - PythonThreadsAllower allower; - s.Assign(OrthancPluginComputeMd5(OrthancPlugins::GetGlobalContext(), (arg0.len > 0 ? arg0.buf : NULL), (arg0.len > 0 ? arg0.len : 0))); - } - PyBuffer_Release(&arg0); - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject* sdk_OrthancPluginComputeSha1(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginComputeSha1()"); - - Py_buffer arg0; - - if (!PyArg_ParseTuple(args, "z*", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - OrthancPlugins::OrthancString s; - { - PythonThreadsAllower allower; - s.Assign(OrthancPluginComputeSha1(OrthancPlugins::GetGlobalContext(), (arg0.len > 0 ? arg0.buf : NULL), (arg0.len > 0 ? arg0.len : 0))); - } - PyBuffer_Release(&arg0); - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject* sdk_OrthancPluginCreateDicom(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginCreateDicom()"); - - const char* arg0 = NULL; - PyObject* arg1 = NULL; - long int arg2 = 0; - - if (!PyArg_ParseTuple(args, "sOl", &arg0, &arg1, &arg2)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); - return NULL; - } - - if (arg1 != Py_None && Py_TYPE(arg1) != GetOrthancPluginImageType()) - { - PyErr_SetString(PyExc_TypeError, "Invalid orthanc.OrthancPluginImage object"); - return NULL; - } - - OrthancPlugins::MemoryBuffer buffer; - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginCreateDicom(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1 == Py_None ? NULL : reinterpret_cast<sdk_OrthancPluginImage_Object*>(arg1)->object_, static_cast<OrthancPluginCreateDicomFlags>(arg2)); - } - - if (code == OrthancPluginErrorCode_Success) - { - return PyBytes_FromStringAndSize(reinterpret_cast<const char*>(buffer.GetData()), buffer.GetSize()); - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject* sdk_OrthancPluginCreateDicom2(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginCreateDicom2()"); - - const char* arg0 = NULL; - PyObject* arg1 = NULL; - long int arg2 = 0; - const char* arg3 = NULL; - - if (!PyArg_ParseTuple(args, "sOls", &arg0, &arg1, &arg2, &arg3)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)"); - return NULL; - } - - if (arg1 != Py_None && Py_TYPE(arg1) != GetOrthancPluginImageType()) - { - PyErr_SetString(PyExc_TypeError, "Invalid orthanc.OrthancPluginImage object"); - return NULL; - } - - OrthancPlugins::MemoryBuffer buffer; - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginCreateDicom2(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1 == Py_None ? NULL : reinterpret_cast<sdk_OrthancPluginImage_Object*>(arg1)->object_, static_cast<OrthancPluginCreateDicomFlags>(arg2), arg3); - } - - if (code == OrthancPluginErrorCode_Success) - { - return PyBytes_FromStringAndSize(reinterpret_cast<const char*>(buffer.GetData()), buffer.GetSize()); - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject* sdk_OrthancPluginCreateDicomInstance(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginCreateDicomInstance()"); - - Py_buffer arg0; - - if (!PyArg_ParseTuple(args, "z*", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - // This is the case of a constructor - OrthancPluginDicomInstance* obj; - { - PythonThreadsAllower allower; - obj = OrthancPluginCreateDicomInstance(OrthancPlugins::GetGlobalContext(), (arg0.len > 0 ? arg0.buf : NULL), (arg0.len > 0 ? arg0.len : 0)); - } - PyBuffer_Release(&arg0); - if (obj == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */); - PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginDicomInstance_Type, argList); - Py_DECREF(argList); - return python; - } -} - -static PyObject* sdk_OrthancPluginCreateFindMatcher(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginCreateFindMatcher()"); - - Py_buffer arg0; - - if (!PyArg_ParseTuple(args, "z*", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - // This is the case of a constructor - OrthancPluginFindMatcher* obj; - { - PythonThreadsAllower allower; - obj = OrthancPluginCreateFindMatcher(OrthancPlugins::GetGlobalContext(), (arg0.len > 0 ? arg0.buf : NULL), (arg0.len > 0 ? arg0.len : 0)); - } - PyBuffer_Release(&arg0); - if (obj == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */); - PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginFindMatcher_Type, argList); - Py_DECREF(argList); - return python; - } -} - -static PyObject* sdk_OrthancPluginCreateImage(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginCreateImage()"); - - long int arg0 = 0; - unsigned long arg1 = 0; - unsigned long arg2 = 0; - - if (!PyArg_ParseTuple(args, "lkk", &arg0, &arg1, &arg2)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); - return NULL; - } - - // This is the case of a constructor - OrthancPluginImage* obj; - { - PythonThreadsAllower allower; - obj = OrthancPluginCreateImage(OrthancPlugins::GetGlobalContext(), static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2); - } - - if (obj == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */); - PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginImage_Type, argList); - Py_DECREF(argList); - return python; - } -} - -static PyObject* sdk_OrthancPluginDecodeDicomImage(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginDecodeDicomImage()"); - - Py_buffer arg0; - unsigned long arg2 = 0; - - if (!PyArg_ParseTuple(args, "z*k", &arg0, &arg2)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - - // This is the case of a constructor - OrthancPluginImage* obj; - { - PythonThreadsAllower allower; - obj = OrthancPluginDecodeDicomImage(OrthancPlugins::GetGlobalContext(), (arg0.len > 0 ? arg0.buf : NULL), (arg0.len > 0 ? arg0.len : 0), arg2); - } - PyBuffer_Release(&arg0); - if (obj == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */); - PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginImage_Type, argList); - Py_DECREF(argList); - return python; - } -} - -static PyObject* sdk_OrthancPluginDicomBufferToJson(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginDicomBufferToJson()"); - - Py_buffer arg0; - long int arg2 = 0; - long int arg3 = 0; - unsigned long arg4 = 0; - - if (!PyArg_ParseTuple(args, "z*llk", &arg0, &arg2, &arg3, &arg4)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)"); - return NULL; - } - - OrthancPlugins::OrthancString s; - { - PythonThreadsAllower allower; - s.Assign(OrthancPluginDicomBufferToJson(OrthancPlugins::GetGlobalContext(), (arg0.len > 0 ? arg0.buf : NULL), (arg0.len > 0 ? arg0.len : 0), static_cast<OrthancPluginDicomToJsonFormat>(arg2), static_cast<OrthancPluginDicomToJsonFlags>(arg3), arg4)); - } - PyBuffer_Release(&arg0); - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject* sdk_OrthancPluginDicomInstanceToJson(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginDicomInstanceToJson()"); - - const char* arg0 = NULL; - long int arg1 = 0; - long int arg2 = 0; - unsigned long arg3 = 0; - - if (!PyArg_ParseTuple(args, "sllk", &arg0, &arg1, &arg2, &arg3)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)"); - return NULL; - } - - OrthancPlugins::OrthancString s; - { - PythonThreadsAllower allower; - s.Assign(OrthancPluginDicomInstanceToJson(OrthancPlugins::GetGlobalContext(), arg0, static_cast<OrthancPluginDicomToJsonFormat>(arg1), static_cast<OrthancPluginDicomToJsonFlags>(arg2), arg3)); - } - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject* sdk_OrthancPluginExtendOrthancExplorer(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginExtendOrthancExplorer()"); - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - { - PythonThreadsAllower allower; - OrthancPluginExtendOrthancExplorer(OrthancPlugins::GetGlobalContext(), arg0); - } - - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject* sdk_OrthancPluginExtendOrthancExplorer2(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginExtendOrthancExplorer2()"); - - const char* arg0 = NULL; - const char* arg1 = NULL; - - if (!PyArg_ParseTuple(args, "ss", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - - { - PythonThreadsAllower allower; - OrthancPluginExtendOrthancExplorer2(OrthancPlugins::GetGlobalContext(), arg0, arg1); - } - - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject* sdk_OrthancPluginGenerateRestApiAuthorizationToken(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginGenerateRestApiAuthorizationToken()"); - - - - OrthancPlugins::OrthancString s; - { - PythonThreadsAllower allower; - s.Assign(OrthancPluginGenerateRestApiAuthorizationToken(OrthancPlugins::GetGlobalContext())); - } - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject* sdk_OrthancPluginGenerateUuid(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginGenerateUuid()"); - - - - OrthancPlugins::OrthancString s; - { - PythonThreadsAllower allower; - s.Assign(OrthancPluginGenerateUuid(OrthancPlugins::GetGlobalContext())); - } - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject* sdk_OrthancPluginGetCommandLineArgument(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginGetCommandLineArgument()"); - - unsigned long arg0 = 0; - - if (!PyArg_ParseTuple(args, "k", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - OrthancPlugins::OrthancString s; - { - PythonThreadsAllower allower; - s.Assign(OrthancPluginGetCommandLineArgument(OrthancPlugins::GetGlobalContext(), arg0)); - } - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject* sdk_OrthancPluginGetCommandLineArgumentsCount(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginGetCommandLineArgumentsCount()"); - - - - long value; - { - PythonThreadsAllower allower; - value = OrthancPluginGetCommandLineArgumentsCount(OrthancPlugins::GetGlobalContext()); - } - - return PyLong_FromLong(value); -} - -static PyObject* sdk_OrthancPluginGetConfiguration(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginGetConfiguration()"); - - - - OrthancPlugins::OrthancString s; - { - PythonThreadsAllower allower; - s.Assign(OrthancPluginGetConfiguration(OrthancPlugins::GetGlobalContext())); - } - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject* sdk_OrthancPluginGetConfigurationPath(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginGetConfigurationPath()"); - - - - OrthancPlugins::OrthancString s; - { - PythonThreadsAllower allower; - s.Assign(OrthancPluginGetConfigurationPath(OrthancPlugins::GetGlobalContext())); - } - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject* sdk_OrthancPluginGetDatabaseServerIdentifier(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginGetDatabaseServerIdentifier()"); - - - - const char* s; - { - PythonThreadsAllower allower; - s = OrthancPluginGetDatabaseServerIdentifier(OrthancPlugins::GetGlobalContext()); - } - - if (s == NULL) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - return PyUnicode_FromString(s); - } -} - -static PyObject* sdk_OrthancPluginGetDicomForInstance(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginGetDicomForInstance()"); - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - OrthancPlugins::MemoryBuffer buffer; - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginGetDicomForInstance(OrthancPlugins::GetGlobalContext(), *buffer, arg0); - } - - if (code == OrthancPluginErrorCode_Success) - { - return PyBytes_FromStringAndSize(reinterpret_cast<const char*>(buffer.GetData()), buffer.GetSize()); - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject* sdk_OrthancPluginGetErrorDescription(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginGetErrorDescription()"); - - long int arg0 = 0; - - if (!PyArg_ParseTuple(args, "l", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - const char* s; - { - PythonThreadsAllower allower; - s = OrthancPluginGetErrorDescription(OrthancPlugins::GetGlobalContext(), static_cast<OrthancPluginErrorCode>(arg0)); - } - - if (s == NULL) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - return PyUnicode_FromString(s); - } -} - -static PyObject* sdk_OrthancPluginGetExpectedDatabaseVersion(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginGetExpectedDatabaseVersion()"); - - - - long value; - { - PythonThreadsAllower allower; - value = OrthancPluginGetExpectedDatabaseVersion(OrthancPlugins::GetGlobalContext()); - } - - return PyLong_FromLong(value); -} - -static PyObject* sdk_OrthancPluginGetFontName(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginGetFontName()"); - - unsigned long arg0 = 0; - - if (!PyArg_ParseTuple(args, "k", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - const char* s; - { - PythonThreadsAllower allower; - s = OrthancPluginGetFontName(OrthancPlugins::GetGlobalContext(), arg0); - } - - if (s == NULL) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - return PyUnicode_FromString(s); - } -} - -static PyObject* sdk_OrthancPluginGetFontSize(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginGetFontSize()"); - - unsigned long arg0 = 0; - - if (!PyArg_ParseTuple(args, "k", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - long value; - { - PythonThreadsAllower allower; - value = OrthancPluginGetFontSize(OrthancPlugins::GetGlobalContext(), arg0); - } - - return PyLong_FromLong(value); -} - -static PyObject* sdk_OrthancPluginGetFontsCount(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginGetFontsCount()"); - - - - long value; - { - PythonThreadsAllower allower; - value = OrthancPluginGetFontsCount(OrthancPlugins::GetGlobalContext()); - } - - return PyLong_FromLong(value); -} - -static PyObject* sdk_OrthancPluginGetGlobalProperty(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginGetGlobalProperty()"); - - long int arg0 = 0; - const char* arg1 = NULL; - - if (!PyArg_ParseTuple(args, "ls", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - - OrthancPlugins::OrthancString s; - { - PythonThreadsAllower allower; - s.Assign(OrthancPluginGetGlobalProperty(OrthancPlugins::GetGlobalContext(), arg0, arg1)); - } - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject* sdk_OrthancPluginGetOrthancDirectory(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginGetOrthancDirectory()"); - - - - OrthancPlugins::OrthancString s; - { - PythonThreadsAllower allower; - s.Assign(OrthancPluginGetOrthancDirectory(OrthancPlugins::GetGlobalContext())); - } - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject* sdk_OrthancPluginGetOrthancPath(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginGetOrthancPath()"); - - - - OrthancPlugins::OrthancString s; - { - PythonThreadsAllower allower; - s.Assign(OrthancPluginGetOrthancPath(OrthancPlugins::GetGlobalContext())); - } - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject* sdk_OrthancPluginGetPeers(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginGetPeers()"); - - - - // This is the case of a constructor - OrthancPluginPeers* obj; - { - PythonThreadsAllower allower; - obj = OrthancPluginGetPeers(OrthancPlugins::GetGlobalContext()); - } - - if (obj == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */); - PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginPeers_Type, argList); - Py_DECREF(argList); - return python; - } -} - -static PyObject* sdk_OrthancPluginGetTagName(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginGetTagName()"); - - unsigned short arg0 = 0; - unsigned short arg1 = 0; - const char* arg2 = NULL; - - if (!PyArg_ParseTuple(args, "HHs", &arg0, &arg1, &arg2)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); - return NULL; - } - - OrthancPlugins::OrthancString s; - { - PythonThreadsAllower allower; - s.Assign(OrthancPluginGetTagName(OrthancPlugins::GetGlobalContext(), arg0, arg1, arg2)); - } - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject* sdk_OrthancPluginHttpDelete(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginHttpDelete()"); - - const char* arg0 = NULL; - const char* arg1 = NULL; - const char* arg2 = NULL; - - if (!PyArg_ParseTuple(args, "sss", &arg0, &arg1, &arg2)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); - return NULL; - } - - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginHttpDelete(OrthancPlugins::GetGlobalContext(), arg0, arg1, arg2); - } - - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject* sdk_OrthancPluginHttpGet(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginHttpGet()"); - - const char* arg0 = NULL; - const char* arg1 = NULL; - const char* arg2 = NULL; - - if (!PyArg_ParseTuple(args, "sss", &arg0, &arg1, &arg2)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); - return NULL; - } - - OrthancPlugins::MemoryBuffer buffer; - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginHttpGet(OrthancPlugins::GetGlobalContext(), *buffer, arg0, arg1, arg2); - } - - if (code == OrthancPluginErrorCode_Success) - { - return PyBytes_FromStringAndSize(reinterpret_cast<const char*>(buffer.GetData()), buffer.GetSize()); - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject* sdk_OrthancPluginHttpPost(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginHttpPost()"); - - const char* arg0 = NULL; - Py_buffer arg1; - const char* arg3 = NULL; - const char* arg4 = NULL; - - if (!PyArg_ParseTuple(args, "sz*ss", &arg0, &arg1, &arg3, &arg4)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)"); - return NULL; - } - - OrthancPlugins::MemoryBuffer buffer; - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginHttpPost(OrthancPlugins::GetGlobalContext(), *buffer, arg0, (arg1.len > 0 ? arg1.buf : NULL), (arg1.len > 0 ? arg1.len : 0), arg3, arg4); - } - PyBuffer_Release(&arg1); - if (code == OrthancPluginErrorCode_Success) - { - return PyBytes_FromStringAndSize(reinterpret_cast<const char*>(buffer.GetData()), buffer.GetSize()); - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject* sdk_OrthancPluginHttpPut(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginHttpPut()"); - - const char* arg0 = NULL; - Py_buffer arg1; - const char* arg3 = NULL; - const char* arg4 = NULL; - - if (!PyArg_ParseTuple(args, "sz*ss", &arg0, &arg1, &arg3, &arg4)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)"); - return NULL; - } - - OrthancPlugins::MemoryBuffer buffer; - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginHttpPut(OrthancPlugins::GetGlobalContext(), *buffer, arg0, (arg1.len > 0 ? arg1.buf : NULL), (arg1.len > 0 ? arg1.len : 0), arg3, arg4); - } - PyBuffer_Release(&arg1); - if (code == OrthancPluginErrorCode_Success) - { - return PyBytes_FromStringAndSize(reinterpret_cast<const char*>(buffer.GetData()), buffer.GetSize()); - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject* sdk_OrthancPluginLoadDicomInstance(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginLoadDicomInstance()"); - - const char* arg0 = NULL; - long int arg1 = 0; - - if (!PyArg_ParseTuple(args, "sl", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - - // This is the case of a constructor - OrthancPluginDicomInstance* obj; - { - PythonThreadsAllower allower; - obj = OrthancPluginLoadDicomInstance(OrthancPlugins::GetGlobalContext(), arg0, static_cast<OrthancPluginLoadDicomInstanceMode>(arg1)); - } - - if (obj == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */); - PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginDicomInstance_Type, argList); - Py_DECREF(argList); - return python; - } -} - -static PyObject* sdk_OrthancPluginLogError(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginLogError()"); - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - { - PythonThreadsAllower allower; - OrthancPluginLogError(OrthancPlugins::GetGlobalContext(), arg0); - } - - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject* sdk_OrthancPluginLogInfo(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginLogInfo()"); - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - { - PythonThreadsAllower allower; - OrthancPluginLogInfo(OrthancPlugins::GetGlobalContext(), arg0); - } - - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject* sdk_OrthancPluginLogMessage(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginLogMessage()"); - - const char* arg0 = NULL; - const char* arg1 = NULL; - const char* arg2 = NULL; - unsigned long arg3 = 0; - long int arg4 = 0; - long int arg5 = 0; - - if (!PyArg_ParseTuple(args, "ssskll", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (6 arguments expected)"); - return NULL; - } - - { - PythonThreadsAllower allower; - OrthancPluginLogMessage(OrthancPlugins::GetGlobalContext(), arg0, arg1, arg2, arg3, static_cast<OrthancPluginLogCategory>(arg4), static_cast<OrthancPluginLogLevel>(arg5)); - } - - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject* sdk_OrthancPluginLogWarning(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginLogWarning()"); - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - { - PythonThreadsAllower allower; - OrthancPluginLogWarning(OrthancPlugins::GetGlobalContext(), arg0); - } - - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject* sdk_OrthancPluginLookupInstance(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginLookupInstance()"); - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - OrthancPlugins::OrthancString s; - { - PythonThreadsAllower allower; - s.Assign(OrthancPluginLookupInstance(OrthancPlugins::GetGlobalContext(), arg0)); - } - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject* sdk_OrthancPluginLookupPatient(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginLookupPatient()"); - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - OrthancPlugins::OrthancString s; - { - PythonThreadsAllower allower; - s.Assign(OrthancPluginLookupPatient(OrthancPlugins::GetGlobalContext(), arg0)); - } - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject* sdk_OrthancPluginLookupSeries(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginLookupSeries()"); - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - OrthancPlugins::OrthancString s; - { - PythonThreadsAllower allower; - s.Assign(OrthancPluginLookupSeries(OrthancPlugins::GetGlobalContext(), arg0)); - } - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject* sdk_OrthancPluginLookupStudy(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginLookupStudy()"); - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - OrthancPlugins::OrthancString s; - { - PythonThreadsAllower allower; - s.Assign(OrthancPluginLookupStudy(OrthancPlugins::GetGlobalContext(), arg0)); - } - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject* sdk_OrthancPluginLookupStudyWithAccessionNumber(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginLookupStudyWithAccessionNumber()"); - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - OrthancPlugins::OrthancString s; - { - PythonThreadsAllower allower; - s.Assign(OrthancPluginLookupStudyWithAccessionNumber(OrthancPlugins::GetGlobalContext(), arg0)); - } - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject* sdk_OrthancPluginReadFile(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginReadFile()"); - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - OrthancPlugins::MemoryBuffer buffer; - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginReadFile(OrthancPlugins::GetGlobalContext(), *buffer, arg0); - } - - if (code == OrthancPluginErrorCode_Success) - { - return PyBytes_FromStringAndSize(reinterpret_cast<const char*>(buffer.GetData()), buffer.GetSize()); - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject* sdk_OrthancPluginRegisterDictionaryTag(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginRegisterDictionaryTag()"); - - unsigned short arg0 = 0; - unsigned short arg1 = 0; - long int arg2 = 0; - const char* arg3 = NULL; - unsigned long arg4 = 0; - unsigned long arg5 = 0; - - if (!PyArg_ParseTuple(args, "HHlskk", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (6 arguments expected)"); - return NULL; - } - - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginRegisterDictionaryTag(OrthancPlugins::GetGlobalContext(), arg0, arg1, static_cast<OrthancPluginValueRepresentation>(arg2), arg3, arg4, arg5); - } - - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject* sdk_OrthancPluginRegisterErrorCode(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginRegisterErrorCode()"); - - long int arg0 = 0; - unsigned short arg1 = 0; - const char* arg2 = NULL; - - if (!PyArg_ParseTuple(args, "lHs", &arg0, &arg1, &arg2)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); - return NULL; - } - - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginRegisterErrorCode(OrthancPlugins::GetGlobalContext(), arg0, arg1, arg2); - } - - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject* sdk_OrthancPluginRegisterPrivateDictionaryTag(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginRegisterPrivateDictionaryTag()"); - - unsigned short arg0 = 0; - unsigned short arg1 = 0; - long int arg2 = 0; - const char* arg3 = NULL; - unsigned long arg4 = 0; - unsigned long arg5 = 0; - const char* arg6 = NULL; - - if (!PyArg_ParseTuple(args, "HHlskks", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (7 arguments expected)"); - return NULL; - } - - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginRegisterPrivateDictionaryTag(OrthancPlugins::GetGlobalContext(), arg0, arg1, static_cast<OrthancPluginValueRepresentation>(arg2), arg3, arg4, arg5, arg6); - } - - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject* sdk_OrthancPluginRestApiDelete(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginRestApiDelete()"); - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginRestApiDelete(OrthancPlugins::GetGlobalContext(), arg0); - } - - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject* sdk_OrthancPluginRestApiDeleteAfterPlugins(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginRestApiDeleteAfterPlugins()"); - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginRestApiDeleteAfterPlugins(OrthancPlugins::GetGlobalContext(), arg0); - } - - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject* sdk_OrthancPluginRestApiGet(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginRestApiGet()"); - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - OrthancPlugins::MemoryBuffer buffer; - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginRestApiGet(OrthancPlugins::GetGlobalContext(), *buffer, arg0); - } - - if (code == OrthancPluginErrorCode_Success) - { - return PyBytes_FromStringAndSize(reinterpret_cast<const char*>(buffer.GetData()), buffer.GetSize()); - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject* sdk_OrthancPluginRestApiGetAfterPlugins(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginRestApiGetAfterPlugins()"); - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - OrthancPlugins::MemoryBuffer buffer; - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginRestApiGetAfterPlugins(OrthancPlugins::GetGlobalContext(), *buffer, arg0); - } - - if (code == OrthancPluginErrorCode_Success) - { - return PyBytes_FromStringAndSize(reinterpret_cast<const char*>(buffer.GetData()), buffer.GetSize()); - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject* sdk_OrthancPluginRestApiPost(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginRestApiPost()"); - - const char* arg0 = NULL; - Py_buffer arg1; - - if (!PyArg_ParseTuple(args, "sz*", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - - OrthancPlugins::MemoryBuffer buffer; - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginRestApiPost(OrthancPlugins::GetGlobalContext(), *buffer, arg0, (arg1.len > 0 ? arg1.buf : NULL), (arg1.len > 0 ? arg1.len : 0)); - } - PyBuffer_Release(&arg1); - if (code == OrthancPluginErrorCode_Success) - { - return PyBytes_FromStringAndSize(reinterpret_cast<const char*>(buffer.GetData()), buffer.GetSize()); - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject* sdk_OrthancPluginRestApiPostAfterPlugins(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginRestApiPostAfterPlugins()"); - - const char* arg0 = NULL; - Py_buffer arg1; - - if (!PyArg_ParseTuple(args, "sz*", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - - OrthancPlugins::MemoryBuffer buffer; - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginRestApiPostAfterPlugins(OrthancPlugins::GetGlobalContext(), *buffer, arg0, (arg1.len > 0 ? arg1.buf : NULL), (arg1.len > 0 ? arg1.len : 0)); - } - PyBuffer_Release(&arg1); - if (code == OrthancPluginErrorCode_Success) - { - return PyBytes_FromStringAndSize(reinterpret_cast<const char*>(buffer.GetData()), buffer.GetSize()); - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject* sdk_OrthancPluginRestApiPut(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginRestApiPut()"); - - const char* arg0 = NULL; - Py_buffer arg1; - - if (!PyArg_ParseTuple(args, "sz*", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - - OrthancPlugins::MemoryBuffer buffer; - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginRestApiPut(OrthancPlugins::GetGlobalContext(), *buffer, arg0, (arg1.len > 0 ? arg1.buf : NULL), (arg1.len > 0 ? arg1.len : 0)); - } - PyBuffer_Release(&arg1); - if (code == OrthancPluginErrorCode_Success) - { - return PyBytes_FromStringAndSize(reinterpret_cast<const char*>(buffer.GetData()), buffer.GetSize()); - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject* sdk_OrthancPluginRestApiPutAfterPlugins(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginRestApiPutAfterPlugins()"); - - const char* arg0 = NULL; - Py_buffer arg1; - - if (!PyArg_ParseTuple(args, "sz*", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - - OrthancPlugins::MemoryBuffer buffer; - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginRestApiPutAfterPlugins(OrthancPlugins::GetGlobalContext(), *buffer, arg0, (arg1.len > 0 ? arg1.buf : NULL), (arg1.len > 0 ? arg1.len : 0)); - } - PyBuffer_Release(&arg1); - if (code == OrthancPluginErrorCode_Success) - { - return PyBytes_FromStringAndSize(reinterpret_cast<const char*>(buffer.GetData()), buffer.GetSize()); - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject* sdk_OrthancPluginSetCurrentThreadName(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginSetCurrentThreadName()"); - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginSetCurrentThreadName(OrthancPlugins::GetGlobalContext(), arg0); - } - - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject* sdk_OrthancPluginSetDescription(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginSetDescription()"); - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - { - PythonThreadsAllower allower; - OrthancPluginSetDescription(OrthancPlugins::GetGlobalContext(), arg0); - } - - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject* sdk_OrthancPluginSetDescription2(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginSetDescription2()"); - - const char* arg0 = NULL; - const char* arg1 = NULL; - - if (!PyArg_ParseTuple(args, "ss", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - - { - PythonThreadsAllower allower; - OrthancPluginSetDescription2(OrthancPlugins::GetGlobalContext(), arg0, arg1); - } - - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject* sdk_OrthancPluginSetGlobalProperty(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginSetGlobalProperty()"); - - long int arg0 = 0; - const char* arg1 = NULL; - - if (!PyArg_ParseTuple(args, "ls", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginSetGlobalProperty(OrthancPlugins::GetGlobalContext(), arg0, arg1); - } - - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject* sdk_OrthancPluginSetMetricsValue(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginSetMetricsValue()"); - - const char* arg0 = NULL; - float arg1 = 0; - long int arg2 = 0; - - if (!PyArg_ParseTuple(args, "sfl", &arg0, &arg1, &arg2)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); - return NULL; - } - - { - PythonThreadsAllower allower; - OrthancPluginSetMetricsValue(OrthancPlugins::GetGlobalContext(), arg0, arg1, static_cast<OrthancPluginMetricsType>(arg2)); - } - - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject* sdk_OrthancPluginSetRootUri(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginSetRootUri()"); - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - { - PythonThreadsAllower allower; - OrthancPluginSetRootUri(OrthancPlugins::GetGlobalContext(), arg0); - } - - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject* sdk_OrthancPluginSetRootUri2(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginSetRootUri2()"); - - const char* arg0 = NULL; - const char* arg1 = NULL; - - if (!PyArg_ParseTuple(args, "ss", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - - { - PythonThreadsAllower allower; - OrthancPluginSetRootUri2(OrthancPlugins::GetGlobalContext(), arg0, arg1); - } - - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject* sdk_OrthancPluginTranscodeDicomInstance(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginTranscodeDicomInstance()"); - - Py_buffer arg0; - const char* arg2 = NULL; - - if (!PyArg_ParseTuple(args, "z*s", &arg0, &arg2)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - - // This is the case of a constructor - OrthancPluginDicomInstance* obj; - { - PythonThreadsAllower allower; - obj = OrthancPluginTranscodeDicomInstance(OrthancPlugins::GetGlobalContext(), (arg0.len > 0 ? arg0.buf : NULL), (arg0.len > 0 ? arg0.len : 0), arg2); - } - PyBuffer_Release(&arg0); - if (obj == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */); - PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginDicomInstance_Type, argList); - Py_DECREF(argList); - return python; - } -} - -static PyObject* sdk_OrthancPluginUncompressImage(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginUncompressImage()"); - - Py_buffer arg0; - long int arg2 = 0; - - if (!PyArg_ParseTuple(args, "z*l", &arg0, &arg2)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - - // This is the case of a constructor - OrthancPluginImage* obj; - { - PythonThreadsAllower allower; - obj = OrthancPluginUncompressImage(OrthancPlugins::GetGlobalContext(), (arg0.len > 0 ? arg0.buf : NULL), (arg0.len > 0 ? arg0.len : 0), static_cast<OrthancPluginImageFormat>(arg2)); - } - PyBuffer_Release(&arg0); - if (obj == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */); - PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginImage_Type, argList); - Py_DECREF(argList); - return python; - } -} - -static PyObject* sdk_OrthancPluginWriteFile(PyObject* module, PyObject* args) -{ - PythonLock::LogCall("Calling Python global function: OrthancPluginWriteFile()"); - - const char* arg0 = NULL; - Py_buffer arg1; - - if (!PyArg_ParseTuple(args, "sz*", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginWriteFile(OrthancPlugins::GetGlobalContext(), arg0, (arg1.len > 0 ? arg1.buf : NULL), (arg1.len > 0 ? arg1.len : 0)); - } - PyBuffer_Release(&arg1); - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - - -static PyMethodDef ORTHANC_SDK_FUNCTIONS[] = -{ - { "AutodetectMimeType", sdk_OrthancPluginAutodetectMimeType, METH_VARARGS, - "Generated from C function OrthancPluginAutodetectMimeType()" }, - { "BufferCompression", sdk_OrthancPluginBufferCompression, METH_VARARGS, - "Generated from C function OrthancPluginBufferCompression()" }, - { "CheckVersion", sdk_OrthancPluginCheckVersion, METH_VARARGS, - "Generated from C function OrthancPluginCheckVersion()" }, - { "CheckVersionAdvanced", sdk_OrthancPluginCheckVersionAdvanced, METH_VARARGS, - "Generated from C function OrthancPluginCheckVersionAdvanced()" }, - { "CompressJpegImage", sdk_OrthancPluginCompressJpegImage, METH_VARARGS, - "Generated from C function OrthancPluginCompressJpegImage()" }, - { "CompressPngImage", sdk_OrthancPluginCompressPngImage, METH_VARARGS, - "Generated from C function OrthancPluginCompressPngImage()" }, - { "ComputeMd5", sdk_OrthancPluginComputeMd5, METH_VARARGS, - "Generated from C function OrthancPluginComputeMd5()" }, - { "ComputeSha1", sdk_OrthancPluginComputeSha1, METH_VARARGS, - "Generated from C function OrthancPluginComputeSha1()" }, - { "CreateDicom", sdk_OrthancPluginCreateDicom, METH_VARARGS, - "Generated from C function OrthancPluginCreateDicom()" }, - { "CreateDicom2", sdk_OrthancPluginCreateDicom2, METH_VARARGS, - "Generated from C function OrthancPluginCreateDicom2()" }, - { "CreateDicomInstance", sdk_OrthancPluginCreateDicomInstance, METH_VARARGS, - "Generated from C function OrthancPluginCreateDicomInstance()" }, - { "CreateFindMatcher", sdk_OrthancPluginCreateFindMatcher, METH_VARARGS, - "Generated from C function OrthancPluginCreateFindMatcher()" }, - { "CreateImage", sdk_OrthancPluginCreateImage, METH_VARARGS, - "Generated from C function OrthancPluginCreateImage()" }, - { "DecodeDicomImage", sdk_OrthancPluginDecodeDicomImage, METH_VARARGS, - "Generated from C function OrthancPluginDecodeDicomImage()" }, - { "DicomBufferToJson", sdk_OrthancPluginDicomBufferToJson, METH_VARARGS, - "Generated from C function OrthancPluginDicomBufferToJson()" }, - { "DicomInstanceToJson", sdk_OrthancPluginDicomInstanceToJson, METH_VARARGS, - "Generated from C function OrthancPluginDicomInstanceToJson()" }, - { "ExtendOrthancExplorer", sdk_OrthancPluginExtendOrthancExplorer, METH_VARARGS, - "Generated from C function OrthancPluginExtendOrthancExplorer()" }, - { "ExtendOrthancExplorer2", sdk_OrthancPluginExtendOrthancExplorer2, METH_VARARGS, - "Generated from C function OrthancPluginExtendOrthancExplorer2()" }, - { "GenerateRestApiAuthorizationToken", sdk_OrthancPluginGenerateRestApiAuthorizationToken, METH_VARARGS, - "Generated from C function OrthancPluginGenerateRestApiAuthorizationToken()" }, - { "GenerateUuid", sdk_OrthancPluginGenerateUuid, METH_VARARGS, - "Generated from C function OrthancPluginGenerateUuid()" }, - { "GetCommandLineArgument", sdk_OrthancPluginGetCommandLineArgument, METH_VARARGS, - "Generated from C function OrthancPluginGetCommandLineArgument()" }, - { "GetCommandLineArgumentsCount", sdk_OrthancPluginGetCommandLineArgumentsCount, METH_VARARGS, - "Generated from C function OrthancPluginGetCommandLineArgumentsCount()" }, - { "GetConfiguration", sdk_OrthancPluginGetConfiguration, METH_VARARGS, - "Generated from C function OrthancPluginGetConfiguration()" }, - { "GetConfigurationPath", sdk_OrthancPluginGetConfigurationPath, METH_VARARGS, - "Generated from C function OrthancPluginGetConfigurationPath()" }, - { "GetDatabaseServerIdentifier", sdk_OrthancPluginGetDatabaseServerIdentifier, METH_VARARGS, - "Generated from C function OrthancPluginGetDatabaseServerIdentifier()" }, - { "GetDicomForInstance", sdk_OrthancPluginGetDicomForInstance, METH_VARARGS, - "Generated from C function OrthancPluginGetDicomForInstance()" }, - { "GetErrorDescription", sdk_OrthancPluginGetErrorDescription, METH_VARARGS, - "Generated from C function OrthancPluginGetErrorDescription()" }, - { "GetExpectedDatabaseVersion", sdk_OrthancPluginGetExpectedDatabaseVersion, METH_VARARGS, - "Generated from C function OrthancPluginGetExpectedDatabaseVersion()" }, - { "GetFontName", sdk_OrthancPluginGetFontName, METH_VARARGS, - "Generated from C function OrthancPluginGetFontName()" }, - { "GetFontSize", sdk_OrthancPluginGetFontSize, METH_VARARGS, - "Generated from C function OrthancPluginGetFontSize()" }, - { "GetFontsCount", sdk_OrthancPluginGetFontsCount, METH_VARARGS, - "Generated from C function OrthancPluginGetFontsCount()" }, - { "GetGlobalProperty", sdk_OrthancPluginGetGlobalProperty, METH_VARARGS, - "Generated from C function OrthancPluginGetGlobalProperty()" }, - { "GetOrthancDirectory", sdk_OrthancPluginGetOrthancDirectory, METH_VARARGS, - "Generated from C function OrthancPluginGetOrthancDirectory()" }, - { "GetOrthancPath", sdk_OrthancPluginGetOrthancPath, METH_VARARGS, - "Generated from C function OrthancPluginGetOrthancPath()" }, - { "GetPeers", sdk_OrthancPluginGetPeers, METH_VARARGS, - "Generated from C function OrthancPluginGetPeers()" }, - { "GetTagName", sdk_OrthancPluginGetTagName, METH_VARARGS, - "Generated from C function OrthancPluginGetTagName()" }, - { "HttpDelete", sdk_OrthancPluginHttpDelete, METH_VARARGS, - "Generated from C function OrthancPluginHttpDelete()" }, - { "HttpGet", sdk_OrthancPluginHttpGet, METH_VARARGS, - "Generated from C function OrthancPluginHttpGet()" }, - { "HttpPost", sdk_OrthancPluginHttpPost, METH_VARARGS, - "Generated from C function OrthancPluginHttpPost()" }, - { "HttpPut", sdk_OrthancPluginHttpPut, METH_VARARGS, - "Generated from C function OrthancPluginHttpPut()" }, - { "LoadDicomInstance", sdk_OrthancPluginLoadDicomInstance, METH_VARARGS, - "Generated from C function OrthancPluginLoadDicomInstance()" }, - { "LogError", sdk_OrthancPluginLogError, METH_VARARGS, - "Generated from C function OrthancPluginLogError()" }, - { "LogInfo", sdk_OrthancPluginLogInfo, METH_VARARGS, - "Generated from C function OrthancPluginLogInfo()" }, - { "LogMessage", sdk_OrthancPluginLogMessage, METH_VARARGS, - "Generated from C function OrthancPluginLogMessage()" }, - { "LogWarning", sdk_OrthancPluginLogWarning, METH_VARARGS, - "Generated from C function OrthancPluginLogWarning()" }, - { "LookupInstance", sdk_OrthancPluginLookupInstance, METH_VARARGS, - "Generated from C function OrthancPluginLookupInstance()" }, - { "LookupPatient", sdk_OrthancPluginLookupPatient, METH_VARARGS, - "Generated from C function OrthancPluginLookupPatient()" }, - { "LookupSeries", sdk_OrthancPluginLookupSeries, METH_VARARGS, - "Generated from C function OrthancPluginLookupSeries()" }, - { "LookupStudy", sdk_OrthancPluginLookupStudy, METH_VARARGS, - "Generated from C function OrthancPluginLookupStudy()" }, - { "LookupStudyWithAccessionNumber", sdk_OrthancPluginLookupStudyWithAccessionNumber, METH_VARARGS, - "Generated from C function OrthancPluginLookupStudyWithAccessionNumber()" }, - { "ReadFile", sdk_OrthancPluginReadFile, METH_VARARGS, - "Generated from C function OrthancPluginReadFile()" }, - { "RegisterDictionaryTag", sdk_OrthancPluginRegisterDictionaryTag, METH_VARARGS, - "Generated from C function OrthancPluginRegisterDictionaryTag()" }, - { "RegisterErrorCode", sdk_OrthancPluginRegisterErrorCode, METH_VARARGS, - "Generated from C function OrthancPluginRegisterErrorCode()" }, - { "RegisterPrivateDictionaryTag", sdk_OrthancPluginRegisterPrivateDictionaryTag, METH_VARARGS, - "Generated from C function OrthancPluginRegisterPrivateDictionaryTag()" }, - { "RestApiDelete", sdk_OrthancPluginRestApiDelete, METH_VARARGS, - "Generated from C function OrthancPluginRestApiDelete()" }, - { "RestApiDeleteAfterPlugins", sdk_OrthancPluginRestApiDeleteAfterPlugins, METH_VARARGS, - "Generated from C function OrthancPluginRestApiDeleteAfterPlugins()" }, - { "RestApiGet", sdk_OrthancPluginRestApiGet, METH_VARARGS, - "Generated from C function OrthancPluginRestApiGet()" }, - { "RestApiGetAfterPlugins", sdk_OrthancPluginRestApiGetAfterPlugins, METH_VARARGS, - "Generated from C function OrthancPluginRestApiGetAfterPlugins()" }, - { "RestApiPost", sdk_OrthancPluginRestApiPost, METH_VARARGS, - "Generated from C function OrthancPluginRestApiPost()" }, - { "RestApiPostAfterPlugins", sdk_OrthancPluginRestApiPostAfterPlugins, METH_VARARGS, - "Generated from C function OrthancPluginRestApiPostAfterPlugins()" }, - { "RestApiPut", sdk_OrthancPluginRestApiPut, METH_VARARGS, - "Generated from C function OrthancPluginRestApiPut()" }, - { "RestApiPutAfterPlugins", sdk_OrthancPluginRestApiPutAfterPlugins, METH_VARARGS, - "Generated from C function OrthancPluginRestApiPutAfterPlugins()" }, - { "SetCurrentThreadName", sdk_OrthancPluginSetCurrentThreadName, METH_VARARGS, - "Generated from C function OrthancPluginSetCurrentThreadName()" }, - { "SetDescription", sdk_OrthancPluginSetDescription, METH_VARARGS, - "Generated from C function OrthancPluginSetDescription()" }, - { "SetDescription2", sdk_OrthancPluginSetDescription2, METH_VARARGS, - "Generated from C function OrthancPluginSetDescription2()" }, - { "SetGlobalProperty", sdk_OrthancPluginSetGlobalProperty, METH_VARARGS, - "Generated from C function OrthancPluginSetGlobalProperty()" }, - { "SetMetricsValue", sdk_OrthancPluginSetMetricsValue, METH_VARARGS, - "Generated from C function OrthancPluginSetMetricsValue()" }, - { "SetRootUri", sdk_OrthancPluginSetRootUri, METH_VARARGS, - "Generated from C function OrthancPluginSetRootUri()" }, - { "SetRootUri2", sdk_OrthancPluginSetRootUri2, METH_VARARGS, - "Generated from C function OrthancPluginSetRootUri2()" }, - { "TranscodeDicomInstance", sdk_OrthancPluginTranscodeDicomInstance, METH_VARARGS, - "Generated from C function OrthancPluginTranscodeDicomInstance()" }, - { "UncompressImage", sdk_OrthancPluginUncompressImage, METH_VARARGS, - "Generated from C function OrthancPluginUncompressImage()" }, - { "WriteFile", sdk_OrthancPluginWriteFile, METH_VARARGS, - "Generated from C function OrthancPluginWriteFile()" }, - { "CreateImageFromBuffer", CreateImageFromBuffer, METH_VARARGS, - "Implemented in C++ function CreateImageFromBuffer()" }, - { "LookupDictionary", LookupDictionary, METH_VARARGS, - "Implemented in C++ function LookupDictionary()" }, - { "RegisterFindCallback", RegisterFindCallback, METH_VARARGS, - "Implemented in C++ function RegisterFindCallback()" }, - { "RegisterIncomingCStoreInstanceFilter", RegisterIncomingCStoreInstanceFilter, METH_VARARGS, - "Implemented in C++ function RegisterIncomingCStoreInstanceFilter()" }, - { "RegisterIncomingHttpRequestFilter", RegisterIncomingHttpRequestFilter, METH_VARARGS, - "Implemented in C++ function RegisterIncomingHttpRequestFilter()" }, - { "RegisterMoveCallback", RegisterMoveCallback, METH_VARARGS, - "Implemented in C++ function RegisterMoveCallback()" }, - { "RegisterMoveCallback2", RegisterMoveCallback2, METH_VARARGS, - "Implemented in C++ function RegisterMoveCallback2()" }, - { "RegisterOnChangeCallback", RegisterOnChangeCallback, METH_VARARGS, - "Implemented in C++ function RegisterOnChangeCallback()" }, - { "RegisterOnStoredInstanceCallback", RegisterOnStoredInstanceCallback, METH_VARARGS, - "Implemented in C++ function RegisterOnStoredInstanceCallback()" }, - { "RegisterReceivedInstanceCallback", RegisterReceivedInstanceCallback, METH_VARARGS, - "Implemented in C++ function RegisterReceivedInstanceCallback()" }, - { "RegisterRestCallback", RegisterRestCallback, METH_VARARGS, - "Implemented in C++ function RegisterRestCallback()" }, - { "RegisterStorageArea", RegisterStorageArea, METH_VARARGS, - "Implemented in C++ function RegisterStorageArea()" }, - { "RegisterStorageCommitmentScpCallback", RegisterStorageCommitmentScpCallback, METH_VARARGS, - "Implemented in C++ function RegisterStorageCommitmentScpCallback()" }, - { "RegisterWorklistCallback", RegisterWorklistCallback, METH_VARARGS, - "Implemented in C++ function RegisterWorklistCallback()" }, - { NULL, NULL } -}; - - -PyMethodDef* GetOrthancSdkFunctions() -{ - return ORTHANC_SDK_FUNCTIONS; -}
--- a/Sources/Autogenerated/sdk_OrthancPluginChangeType.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,198 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginChangeType_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginChangeType_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.ChangeType", /* tp_name */ - sizeof(sdk_OrthancPluginChangeType_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginChangeTypeEnumeration(PyObject* module) -{ - sdk_OrthancPluginChangeType_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginChangeType_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginChangeType_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginChangeType"; - - sdk_OrthancPluginChangeType_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginChangeType_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginChangeType"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(0); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "COMPLETED_SERIES", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "DELETED", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "NEW_CHILD_INSTANCE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(3); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "NEW_INSTANCE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(4); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "NEW_PATIENT", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(5); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "NEW_SERIES", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(6); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "NEW_STUDY", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(7); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "STABLE_PATIENT", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(8); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "STABLE_SERIES", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(9); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "STABLE_STUDY", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(10); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "ORTHANC_STARTED", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(11); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "ORTHANC_STOPPED", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(12); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "UPDATED_ATTACHMENT", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(13); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "UPDATED_METADATA", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(14); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "UPDATED_PEERS", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(15); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "UPDATED_MODALITIES", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(16); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "JOB_SUBMITTED", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(17); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "JOB_SUCCESS", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(18); - PyDict_SetItemString(sdk_OrthancPluginChangeType_Type.tp_dict, "JOB_FAILURE", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginChangeType_Type); - if (PyModule_AddObject(module, "ChangeType", (PyObject *)&sdk_OrthancPluginChangeType_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginChangeType"); - Py_DECREF(&sdk_OrthancPluginChangeType_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginCompressionType.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginCompressionType_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginCompressionType_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.CompressionType", /* tp_name */ - sizeof(sdk_OrthancPluginCompressionType_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginCompressionTypeEnumeration(PyObject* module) -{ - sdk_OrthancPluginCompressionType_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginCompressionType_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginCompressionType_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginCompressionType"; - - sdk_OrthancPluginCompressionType_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginCompressionType_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginCompressionType"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(0); - PyDict_SetItemString(sdk_OrthancPluginCompressionType_Type.tp_dict, "ZLIB", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginCompressionType_Type.tp_dict, "ZLIB_WITH_SIZE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2); - PyDict_SetItemString(sdk_OrthancPluginCompressionType_Type.tp_dict, "GZIP", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(3); - PyDict_SetItemString(sdk_OrthancPluginCompressionType_Type.tp_dict, "GZIP_WITH_SIZE", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginCompressionType_Type); - if (PyModule_AddObject(module, "CompressionType", (PyObject *)&sdk_OrthancPluginCompressionType_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginCompressionType"); - Py_DECREF(&sdk_OrthancPluginCompressionType_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginConstraintType.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginConstraintType_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginConstraintType_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.ConstraintType", /* tp_name */ - sizeof(sdk_OrthancPluginConstraintType_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginConstraintTypeEnumeration(PyObject* module) -{ - sdk_OrthancPluginConstraintType_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginConstraintType_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginConstraintType_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginConstraintType"; - - sdk_OrthancPluginConstraintType_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginConstraintType_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginConstraintType"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginConstraintType_Type.tp_dict, "EQUAL", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2); - PyDict_SetItemString(sdk_OrthancPluginConstraintType_Type.tp_dict, "SMALLER_OR_EQUAL", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(3); - PyDict_SetItemString(sdk_OrthancPluginConstraintType_Type.tp_dict, "GREATER_OR_EQUAL", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(4); - PyDict_SetItemString(sdk_OrthancPluginConstraintType_Type.tp_dict, "WILDCARD", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(5); - PyDict_SetItemString(sdk_OrthancPluginConstraintType_Type.tp_dict, "LIST", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginConstraintType_Type); - if (PyModule_AddObject(module, "ConstraintType", (PyObject *)&sdk_OrthancPluginConstraintType_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginConstraintType"); - Py_DECREF(&sdk_OrthancPluginConstraintType_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginContentType.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginContentType_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginContentType_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.ContentType", /* tp_name */ - sizeof(sdk_OrthancPluginContentType_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginContentTypeEnumeration(PyObject* module) -{ - sdk_OrthancPluginContentType_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginContentType_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginContentType_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginContentType"; - - sdk_OrthancPluginContentType_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginContentType_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginContentType"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(0); - PyDict_SetItemString(sdk_OrthancPluginContentType_Type.tp_dict, "UNKNOWN", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginContentType_Type.tp_dict, "DICOM", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2); - PyDict_SetItemString(sdk_OrthancPluginContentType_Type.tp_dict, "DICOM_AS_JSON", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(3); - PyDict_SetItemString(sdk_OrthancPluginContentType_Type.tp_dict, "DICOM_UNTIL_PIXEL_DATA", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginContentType_Type); - if (PyModule_AddObject(module, "ContentType", (PyObject *)&sdk_OrthancPluginContentType_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginContentType"); - Py_DECREF(&sdk_OrthancPluginContentType_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginCreateDicomFlags.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginCreateDicomFlags_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginCreateDicomFlags_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.CreateDicomFlags", /* tp_name */ - sizeof(sdk_OrthancPluginCreateDicomFlags_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginCreateDicomFlagsEnumeration(PyObject* module) -{ - sdk_OrthancPluginCreateDicomFlags_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginCreateDicomFlags_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginCreateDicomFlags_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginCreateDicomFlags"; - - sdk_OrthancPluginCreateDicomFlags_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginCreateDicomFlags_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginCreateDicomFlags"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(0); - PyDict_SetItemString(sdk_OrthancPluginCreateDicomFlags_Type.tp_dict, "NONE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginCreateDicomFlags_Type.tp_dict, "DECODE_DATA_URI_SCHEME", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2); - PyDict_SetItemString(sdk_OrthancPluginCreateDicomFlags_Type.tp_dict, "GENERATE_IDENTIFIERS", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginCreateDicomFlags_Type); - if (PyModule_AddObject(module, "CreateDicomFlags", (PyObject *)&sdk_OrthancPluginCreateDicomFlags_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginCreateDicomFlags"); - Py_DECREF(&sdk_OrthancPluginCreateDicomFlags_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginDicomInstance.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,207 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Forward declaration of the autogenerated methods -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceRemoteAet( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceSize( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceJson( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceSimplifiedJson( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginHasInstanceMetadata( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceMetadata( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceOrigin( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceTransferSyntaxUid( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginHasInstancePixelData( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceFramesCount( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceRawFrame( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceDecodedFrame( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginSerializeDicomInstance( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceAdvancedJson( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args); -// End of forward declarations - - -// Forward declaration of the custom methods -extern PyObject *GetInstanceData(sdk_OrthancPluginDicomInstance_Object* self, PyObject *args); -// End of forward declarations - - -static PyMethodDef sdk_OrthancPluginDicomInstance_Methods[] = { - { "GetInstanceRemoteAet", - (PyCFunction) sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceRemoteAet, METH_VARARGS, - "Generated from C function OrthancPluginGetInstanceRemoteAet()" }, - { "GetInstanceSize", - (PyCFunction) sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceSize, METH_VARARGS, - "Generated from C function OrthancPluginGetInstanceSize()" }, - { "GetInstanceJson", - (PyCFunction) sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceJson, METH_VARARGS, - "Generated from C function OrthancPluginGetInstanceJson()" }, - { "GetInstanceSimplifiedJson", - (PyCFunction) sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceSimplifiedJson, METH_VARARGS, - "Generated from C function OrthancPluginGetInstanceSimplifiedJson()" }, - { "HasInstanceMetadata", - (PyCFunction) sdk_OrthancPluginDicomInstance_OrthancPluginHasInstanceMetadata, METH_VARARGS, - "Generated from C function OrthancPluginHasInstanceMetadata()" }, - { "GetInstanceMetadata", - (PyCFunction) sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceMetadata, METH_VARARGS, - "Generated from C function OrthancPluginGetInstanceMetadata()" }, - { "GetInstanceOrigin", - (PyCFunction) sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceOrigin, METH_VARARGS, - "Generated from C function OrthancPluginGetInstanceOrigin()" }, - { "GetInstanceTransferSyntaxUid", - (PyCFunction) sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceTransferSyntaxUid, METH_VARARGS, - "Generated from C function OrthancPluginGetInstanceTransferSyntaxUid()" }, - { "HasInstancePixelData", - (PyCFunction) sdk_OrthancPluginDicomInstance_OrthancPluginHasInstancePixelData, METH_VARARGS, - "Generated from C function OrthancPluginHasInstancePixelData()" }, - { "GetInstanceFramesCount", - (PyCFunction) sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceFramesCount, METH_VARARGS, - "Generated from C function OrthancPluginGetInstanceFramesCount()" }, - { "GetInstanceRawFrame", - (PyCFunction) sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceRawFrame, METH_VARARGS, - "Generated from C function OrthancPluginGetInstanceRawFrame()" }, - { "GetInstanceDecodedFrame", - (PyCFunction) sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceDecodedFrame, METH_VARARGS, - "Generated from C function OrthancPluginGetInstanceDecodedFrame()" }, - { "SerializeDicomInstance", - (PyCFunction) sdk_OrthancPluginDicomInstance_OrthancPluginSerializeDicomInstance, METH_VARARGS, - "Generated from C function OrthancPluginSerializeDicomInstance()" }, - { "GetInstanceAdvancedJson", - (PyCFunction) sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceAdvancedJson, METH_VARARGS, - "Generated from C function OrthancPluginGetInstanceAdvancedJson()" }, - { "GetInstanceData", - (PyCFunction) GetInstanceData, METH_VARARGS, - "Implemented in C++ function GetInstanceData()" }, - { NULL } /* Sentinel */ -}; - - -static int sdk_OrthancPluginDicomInstance_Constructor( - sdk_OrthancPluginDicomInstance_Object *self, PyObject *args, PyObject *kwds) -{ - PythonLock::LogCall("Creating Python object of class OrthancPluginDicomInstance"); - - self->object_ = NULL; - self->borrowed_ = false; - - long long object = 0; - unsigned char borrowed = false; - - if (PyArg_ParseTuple(args, "Lb", &object, &borrowed)) - { - self->object_ = reinterpret_cast<OrthancPluginDicomInstance*>(static_cast<intptr_t>(object)); - self->borrowed_ = borrowed; - return 0; - } - else - { - PyErr_SetString(PyExc_ValueError, "Expected a pair (pointer, borrowed) in the constructor"); - return -1; - } -} - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginDicomInstance_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.DicomInstance", /* tp_name */ - sizeof(sdk_OrthancPluginDicomInstance_Object), /* tp_basicsize */ -}; - - -static void sdk_OrthancPluginDicomInstance_Destructor(PyObject *self) -{ - PythonLock::LogCall("Destroying Python object of class OrthancPluginDicomInstance"); - - sdk_OrthancPluginDicomInstance_Object& tmp = *((sdk_OrthancPluginDicomInstance_Object*) self); - - if (tmp.object_ != NULL && - !tmp.borrowed_) - { - OrthancPluginFreeDicomInstance(OrthancPlugins::GetGlobalContext(), tmp.object_); - tmp.object_ = NULL; - } - - Py_TYPE(self)->tp_free((PyObject *)self); -} - - -static void RegisterOrthancPluginDicomInstanceClass(PyObject* module) -{ - sdk_OrthancPluginDicomInstance_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginDicomInstance_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginDicomInstance_Type.tp_doc = "Generated from Orthanc C class: OrthancPluginDicomInstance"; - sdk_OrthancPluginDicomInstance_Type.tp_methods = sdk_OrthancPluginDicomInstance_Methods; - sdk_OrthancPluginDicomInstance_Type.tp_init = (initproc) sdk_OrthancPluginDicomInstance_Constructor; - - /** - * "tp_dealloc is called when the reference count of the object goes - * down to zero. This is where you destroy the object and its - * members. It should then free the memory occupied by the object by - * calling tp_free." - * https://stackoverflow.com/a/24863227/881731 - **/ - sdk_OrthancPluginDicomInstance_Type.tp_dealloc = sdk_OrthancPluginDicomInstance_Destructor; - - if (PyType_Ready(&sdk_OrthancPluginDicomInstance_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginDicomInstance"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - Py_INCREF(&sdk_OrthancPluginDicomInstance_Type); - if (PyModule_AddObject(module, "DicomInstance", (PyObject *)&sdk_OrthancPluginDicomInstance_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginDicomInstance"); - Py_DECREF(&sdk_OrthancPluginDicomInstance_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -} - - -PyTypeObject* GetOrthancPluginDicomInstanceType() -{ - return &sdk_OrthancPluginDicomInstance_Type; -}
--- a/Sources/Autogenerated/sdk_OrthancPluginDicomInstance.methods.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,448 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Actual implementation of the methods -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceRemoteAet( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetInstanceRemoteAet() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - - const char* s; - { - PythonThreadsAllower allower; - s = OrthancPluginGetInstanceRemoteAet(OrthancPlugins::GetGlobalContext(), self->object_); - } - - if (s == NULL) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - return PyUnicode_FromString(s); - } -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceSize( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetInstanceSize() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - - long value; - { - PythonThreadsAllower allower; - value = OrthancPluginGetInstanceSize(OrthancPlugins::GetGlobalContext(), self->object_); - } - - return PyLong_FromLong(value); -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceJson( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetInstanceJson() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - - OrthancPlugins::OrthancString s; - { - PythonThreadsAllower allower; - s.Assign(OrthancPluginGetInstanceJson(OrthancPlugins::GetGlobalContext(), self->object_)); - } - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceSimplifiedJson( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetInstanceSimplifiedJson() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - - OrthancPlugins::OrthancString s; - { - PythonThreadsAllower allower; - s.Assign(OrthancPluginGetInstanceSimplifiedJson(OrthancPlugins::GetGlobalContext(), self->object_)); - } - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginHasInstanceMetadata( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginHasInstanceMetadata() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - long value; - { - PythonThreadsAllower allower; - value = OrthancPluginHasInstanceMetadata(OrthancPlugins::GetGlobalContext(), self->object_, arg0); - } - - return PyLong_FromLong(value); -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceMetadata( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetInstanceMetadata() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - const char* s; - { - PythonThreadsAllower allower; - s = OrthancPluginGetInstanceMetadata(OrthancPlugins::GetGlobalContext(), self->object_, arg0); - } - - if (s == NULL) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - return PyUnicode_FromString(s); - } -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceOrigin( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetInstanceOrigin() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - - OrthancPluginInstanceOrigin value; - { - PythonThreadsAllower allower; - value = OrthancPluginGetInstanceOrigin(OrthancPlugins::GetGlobalContext(), self->object_); - } - - return PyLong_FromLong(value); -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceTransferSyntaxUid( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetInstanceTransferSyntaxUid() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - - OrthancPlugins::OrthancString s; - { - PythonThreadsAllower allower; - s.Assign(OrthancPluginGetInstanceTransferSyntaxUid(OrthancPlugins::GetGlobalContext(), self->object_)); - } - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginHasInstancePixelData( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginHasInstancePixelData() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - - long value; - { - PythonThreadsAllower allower; - value = OrthancPluginHasInstancePixelData(OrthancPlugins::GetGlobalContext(), self->object_); - } - - return PyLong_FromLong(value); -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceFramesCount( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetInstanceFramesCount() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - - long value; - { - PythonThreadsAllower allower; - value = OrthancPluginGetInstanceFramesCount(OrthancPlugins::GetGlobalContext(), self->object_); - } - - return PyLong_FromLong(value); -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceRawFrame( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetInstanceRawFrame() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - unsigned long arg0 = 0; - - if (!PyArg_ParseTuple(args, "k", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - OrthancPlugins::MemoryBuffer buffer; - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginGetInstanceRawFrame(OrthancPlugins::GetGlobalContext(), *buffer, self->object_, arg0); - } - - if (code == OrthancPluginErrorCode_Success) - { - return PyBytes_FromStringAndSize(reinterpret_cast<const char*>(buffer.GetData()), buffer.GetSize()); - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceDecodedFrame( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetInstanceDecodedFrame() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - unsigned long arg0 = 0; - - if (!PyArg_ParseTuple(args, "k", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - // This is the case of a constructor - OrthancPluginImage* obj; - { - PythonThreadsAllower allower; - obj = OrthancPluginGetInstanceDecodedFrame(OrthancPlugins::GetGlobalContext(), self->object_, arg0); - } - - if (obj == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */); - PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginImage_Type, argList); - Py_DECREF(argList); - return python; - } -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginSerializeDicomInstance( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginSerializeDicomInstance() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - - OrthancPlugins::MemoryBuffer buffer; - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginSerializeDicomInstance(OrthancPlugins::GetGlobalContext(), *buffer, self->object_); - } - - if (code == OrthancPluginErrorCode_Success) - { - return PyBytes_FromStringAndSize(reinterpret_cast<const char*>(buffer.GetData()), buffer.GetSize()); - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject *sdk_OrthancPluginDicomInstance_OrthancPluginGetInstanceAdvancedJson( - sdk_OrthancPluginDicomInstance_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetInstanceAdvancedJson() on object of class OrthancPluginDicomInstance"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - long int arg0 = 0; - long int arg1 = 0; - unsigned long arg2 = 0; - - if (!PyArg_ParseTuple(args, "llk", &arg0, &arg1, &arg2)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); - return NULL; - } - - OrthancPlugins::OrthancString s; - { - PythonThreadsAllower allower; - s.Assign(OrthancPluginGetInstanceAdvancedJson(OrthancPlugins::GetGlobalContext(), self->object_, static_cast<OrthancPluginDicomToJsonFormat>(arg0), static_cast<OrthancPluginDicomToJsonFlags>(arg1), arg2)); - } - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} -
--- a/Sources/Autogenerated/sdk_OrthancPluginDicomToJsonFlags.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,138 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginDicomToJsonFlags_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginDicomToJsonFlags_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.DicomToJsonFlags", /* tp_name */ - sizeof(sdk_OrthancPluginDicomToJsonFlags_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginDicomToJsonFlagsEnumeration(PyObject* module) -{ - sdk_OrthancPluginDicomToJsonFlags_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginDicomToJsonFlags_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginDicomToJsonFlags_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginDicomToJsonFlags"; - - sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginDicomToJsonFlags_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginDicomToJsonFlags"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(0); - PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "NONE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "INCLUDE_BINARY", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2); - PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "INCLUDE_PRIVATE_TAGS", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(4); - PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "INCLUDE_UNKNOWN_TAGS", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(8); - PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "INCLUDE_PIXEL_DATA", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(16); - PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "CONVERT_BINARY_TO_ASCII", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(32); - PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "CONVERT_BINARY_TO_NULL", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(64); - PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "STOP_AFTER_PIXEL_DATA", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(128); - PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFlags_Type.tp_dict, "SKIP_GROUP_LENGTHS", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginDicomToJsonFlags_Type); - if (PyModule_AddObject(module, "DicomToJsonFlags", (PyObject *)&sdk_OrthancPluginDicomToJsonFlags_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginDicomToJsonFlags"); - Py_DECREF(&sdk_OrthancPluginDicomToJsonFlags_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginDicomToJsonFormat.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginDicomToJsonFormat_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginDicomToJsonFormat_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.DicomToJsonFormat", /* tp_name */ - sizeof(sdk_OrthancPluginDicomToJsonFormat_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginDicomToJsonFormatEnumeration(PyObject* module) -{ - sdk_OrthancPluginDicomToJsonFormat_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginDicomToJsonFormat_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginDicomToJsonFormat_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginDicomToJsonFormat"; - - sdk_OrthancPluginDicomToJsonFormat_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginDicomToJsonFormat_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginDicomToJsonFormat"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFormat_Type.tp_dict, "FULL", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2); - PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFormat_Type.tp_dict, "SHORT", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(3); - PyDict_SetItemString(sdk_OrthancPluginDicomToJsonFormat_Type.tp_dict, "HUMAN", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginDicomToJsonFormat_Type); - if (PyModule_AddObject(module, "DicomToJsonFormat", (PyObject *)&sdk_OrthancPluginDicomToJsonFormat_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginDicomToJsonFormat"); - Py_DECREF(&sdk_OrthancPluginDicomToJsonFormat_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginDicomWebBinaryMode.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginDicomWebBinaryMode_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginDicomWebBinaryMode_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.DicomWebBinaryMode", /* tp_name */ - sizeof(sdk_OrthancPluginDicomWebBinaryMode_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginDicomWebBinaryModeEnumeration(PyObject* module) -{ - sdk_OrthancPluginDicomWebBinaryMode_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginDicomWebBinaryMode_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginDicomWebBinaryMode_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginDicomWebBinaryMode"; - - sdk_OrthancPluginDicomWebBinaryMode_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginDicomWebBinaryMode_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginDicomWebBinaryMode"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(0); - PyDict_SetItemString(sdk_OrthancPluginDicomWebBinaryMode_Type.tp_dict, "IGNORE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginDicomWebBinaryMode_Type.tp_dict, "INLINE_BINARY", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2); - PyDict_SetItemString(sdk_OrthancPluginDicomWebBinaryMode_Type.tp_dict, "BULK_DATA_URI", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginDicomWebBinaryMode_Type); - if (PyModule_AddObject(module, "DicomWebBinaryMode", (PyObject *)&sdk_OrthancPluginDicomWebBinaryMode_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginDicomWebBinaryMode"); - Py_DECREF(&sdk_OrthancPluginDicomWebBinaryMode_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginDicomWebNode.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Forward declaration of the autogenerated methods -// End of forward declarations - - -// Forward declaration of the custom methods -// End of forward declarations - - -static PyMethodDef sdk_OrthancPluginDicomWebNode_Methods[] = { - { NULL } /* Sentinel */ -}; - - -static int sdk_OrthancPluginDicomWebNode_Constructor( - sdk_OrthancPluginDicomWebNode_Object *self, PyObject *args, PyObject *kwds) -{ - PythonLock::LogCall("Creating Python object of class OrthancPluginDicomWebNode"); - - self->object_ = NULL; - self->borrowed_ = false; - - long long object = 0; - unsigned char borrowed = false; - - if (PyArg_ParseTuple(args, "Lb", &object, &borrowed)) - { - self->object_ = reinterpret_cast<OrthancPluginDicomWebNode*>(static_cast<intptr_t>(object)); - self->borrowed_ = borrowed; - return 0; - } - else - { - PyErr_SetString(PyExc_ValueError, "Expected a pair (pointer, borrowed) in the constructor"); - return -1; - } -} - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginDicomWebNode_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.DicomWebNode", /* tp_name */ - sizeof(sdk_OrthancPluginDicomWebNode_Object), /* tp_basicsize */ -}; - - - - -static void RegisterOrthancPluginDicomWebNodeClass(PyObject* module) -{ - sdk_OrthancPluginDicomWebNode_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginDicomWebNode_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginDicomWebNode_Type.tp_doc = "Generated from Orthanc C class: OrthancPluginDicomWebNode"; - sdk_OrthancPluginDicomWebNode_Type.tp_methods = sdk_OrthancPluginDicomWebNode_Methods; - sdk_OrthancPluginDicomWebNode_Type.tp_init = (initproc) sdk_OrthancPluginDicomWebNode_Constructor; - - - if (PyType_Ready(&sdk_OrthancPluginDicomWebNode_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginDicomWebNode"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - Py_INCREF(&sdk_OrthancPluginDicomWebNode_Type); - if (PyModule_AddObject(module, "DicomWebNode", (PyObject *)&sdk_OrthancPluginDicomWebNode_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginDicomWebNode"); - Py_DECREF(&sdk_OrthancPluginDicomWebNode_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -} - - -PyTypeObject* GetOrthancPluginDicomWebNodeType() -{ - return &sdk_OrthancPluginDicomWebNode_Type; -}
--- a/Sources/Autogenerated/sdk_OrthancPluginDicomWebNode.methods.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Actual implementation of the methods
--- a/Sources/Autogenerated/sdk_OrthancPluginErrorCode.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,756 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginErrorCode_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginErrorCode_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.ErrorCode", /* tp_name */ - sizeof(sdk_OrthancPluginErrorCode_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginErrorCodeEnumeration(PyObject* module) -{ - sdk_OrthancPluginErrorCode_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginErrorCode_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginErrorCode_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginErrorCode"; - - sdk_OrthancPluginErrorCode_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginErrorCode_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginErrorCode"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(-1); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "INTERNAL_ERROR", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(0); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SUCCESS", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "PLUGIN", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NOT_IMPLEMENTED", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(3); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "PARAMETER_OUT_OF_RANGE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(4); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NOT_ENOUGH_MEMORY", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(5); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_PARAMETER_TYPE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(6); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_SEQUENCE_OF_CALLS", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(7); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "INEXISTENT_ITEM", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(8); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_REQUEST", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(9); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NETWORK_PROTOCOL", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(10); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SYSTEM_COMMAND", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(11); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DATABASE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(12); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "URI_SYNTAX", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(13); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "INEXISTENT_FILE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(14); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CANNOT_WRITE_FILE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(15); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_FILE_FORMAT", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(16); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "TIMEOUT", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(17); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "UNKNOWN_RESOURCE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(18); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "INCOMPATIBLE_DATABASE_VERSION", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(19); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "FULL_STORAGE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(20); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CORRUPTED_FILE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(21); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "INEXISTENT_TAG", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(22); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "READ_ONLY", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(23); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "INCOMPATIBLE_IMAGE_FORMAT", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(24); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "INCOMPATIBLE_IMAGE_SIZE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(25); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SHARED_LIBRARY", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(26); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "UNKNOWN_PLUGIN_SERVICE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(27); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "UNKNOWN_DICOM_TAG", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(28); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_JSON", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(29); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "UNAUTHORIZED", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(30); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_FONT", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(31); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DATABASE_PLUGIN", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(32); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "STORAGE_AREA_PLUGIN", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(33); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "EMPTY_REQUEST", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(34); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NOT_ACCEPTABLE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(35); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NULL_POINTER", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(36); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DATABASE_UNAVAILABLE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(37); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CANCELED_JOB", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(38); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_GEOMETRY", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(39); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SSL_INITIALIZATION", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(40); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DISCONTINUED_ABI", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(41); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_RANGE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(42); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DATABASE_CANNOT_SERIALIZE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(43); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "REVISION", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(44); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "MAIN_DICOM_TAGS_MULTIPLY_DEFINED", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(45); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "FORBIDDEN_ACCESS", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(46); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DUPLICATE_RESOURCE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(47); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "INCOMPATIBLE_CONFIGURATIONS", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1000); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_NOT_OPENED", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1001); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_ALREADY_OPENED", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1002); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_CANNOT_OPEN", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1003); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_STATEMENT_ALREADY_USED", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1004); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_EXECUTE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1005); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_ROLLBACK_WITHOUT_TRANSACTION", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1006); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_COMMIT_WITHOUT_TRANSACTION", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1007); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_REGISTER_FUNCTION", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1008); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_FLUSH", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1009); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_CANNOT_RUN", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1010); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_CANNOT_STEP", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1011); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_BIND_OUT_OF_RANGE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1012); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_PREPARE_STATEMENT", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1013); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_TRANSACTION_ALREADY_STARTED", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1014); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_TRANSACTION_COMMIT", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1015); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SQLITE_TRANSACTION_BEGIN", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2000); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DIRECTORY_OVER_FILE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2001); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "FILE_STORAGE_CANNOT_WRITE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2002); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DIRECTORY_EXPECTED", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2003); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "HTTP_PORT_IN_USE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2004); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DICOM_PORT_IN_USE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2005); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_HTTP_STATUS_IN_REST", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2006); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "REGULAR_FILE_EXPECTED", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2007); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "PATH_TO_EXECUTABLE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2008); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "MAKE_DIRECTORY", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2009); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_APPLICATION_ENTITY_TITLE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2010); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_CFIND_HANDLER", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2011); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_CMOVE_HANDLER", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2012); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_CSTORE_HANDLER", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2013); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_APPLICATION_ENTITY_FILTER", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2014); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_SOP_CLASS_OR_INSTANCE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2015); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_PRESENTATION_CONTEXT", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2016); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DICOM_FIND_UNAVAILABLE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2017); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DICOM_MOVE_UNAVAILABLE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2018); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CANNOT_STORE_INSTANCE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2019); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CREATE_DICOM_NOT_STRING", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2020); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CREATE_DICOM_OVERRIDE_TAG", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2021); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CREATE_DICOM_USE_CONTENT", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2022); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CREATE_DICOM_NO_PAYLOAD", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2023); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CREATE_DICOM_USE_DATA_URI_SCHEME", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2024); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CREATE_DICOM_BAD_PARENT", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2025); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CREATE_DICOM_PARENT_IS_INSTANCE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2026); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CREATE_DICOM_PARENT_ENCODING", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2027); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "UNKNOWN_MODALITY", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2028); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "BAD_JOB_ORDERING", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2029); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "JSON_TO_LUA_TABLE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2030); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CANNOT_CREATE_LUA", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2031); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CANNOT_EXECUTE_LUA", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2032); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "LUA_ALREADY_EXECUTED", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2033); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "LUA_BAD_OUTPUT", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2034); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NOT_LUA_PREDICATE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2035); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "LUA_RETURNS_NO_STRING", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2036); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "STORAGE_AREA_ALREADY_REGISTERED", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2037); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DATABASE_BACKEND_ALREADY_REGISTERED", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2038); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DATABASE_NOT_INITIALIZED", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2039); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "SSL_DISABLED", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2040); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "CANNOT_ORDER_SLICES", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2041); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_WORKLIST_HANDLER", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2042); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "ALREADY_EXISTING_TAG", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2043); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_STORAGE_COMMITMENT_HANDLER", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2044); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "NO_CGET_HANDLER", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2045); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "DICOM_GET_UNAVAILABLE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(3000); - PyDict_SetItemString(sdk_OrthancPluginErrorCode_Type.tp_dict, "UNSUPPORTED_MEDIA_TYPE", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginErrorCode_Type); - if (PyModule_AddObject(module, "ErrorCode", (PyObject *)&sdk_OrthancPluginErrorCode_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginErrorCode"); - Py_DECREF(&sdk_OrthancPluginErrorCode_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginFindAnswers.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,120 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Forward declaration of the autogenerated methods -static PyObject *sdk_OrthancPluginFindAnswers_OrthancPluginFindAddAnswer( - sdk_OrthancPluginFindAnswers_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginFindAnswers_OrthancPluginFindMarkIncomplete( - sdk_OrthancPluginFindAnswers_Object* self, PyObject *args); -// End of forward declarations - - -// Forward declaration of the custom methods -// End of forward declarations - - -static PyMethodDef sdk_OrthancPluginFindAnswers_Methods[] = { - { "FindAddAnswer", - (PyCFunction) sdk_OrthancPluginFindAnswers_OrthancPluginFindAddAnswer, METH_VARARGS, - "Generated from C function OrthancPluginFindAddAnswer()" }, - { "FindMarkIncomplete", - (PyCFunction) sdk_OrthancPluginFindAnswers_OrthancPluginFindMarkIncomplete, METH_VARARGS, - "Generated from C function OrthancPluginFindMarkIncomplete()" }, - { NULL } /* Sentinel */ -}; - - -static int sdk_OrthancPluginFindAnswers_Constructor( - sdk_OrthancPluginFindAnswers_Object *self, PyObject *args, PyObject *kwds) -{ - PythonLock::LogCall("Creating Python object of class OrthancPluginFindAnswers"); - - self->object_ = NULL; - self->borrowed_ = false; - - long long object = 0; - unsigned char borrowed = false; - - if (PyArg_ParseTuple(args, "Lb", &object, &borrowed)) - { - self->object_ = reinterpret_cast<OrthancPluginFindAnswers*>(static_cast<intptr_t>(object)); - self->borrowed_ = borrowed; - return 0; - } - else - { - PyErr_SetString(PyExc_ValueError, "Expected a pair (pointer, borrowed) in the constructor"); - return -1; - } -} - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginFindAnswers_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.FindAnswers", /* tp_name */ - sizeof(sdk_OrthancPluginFindAnswers_Object), /* tp_basicsize */ -}; - - - - -static void RegisterOrthancPluginFindAnswersClass(PyObject* module) -{ - sdk_OrthancPluginFindAnswers_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginFindAnswers_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginFindAnswers_Type.tp_doc = "Generated from Orthanc C class: OrthancPluginFindAnswers"; - sdk_OrthancPluginFindAnswers_Type.tp_methods = sdk_OrthancPluginFindAnswers_Methods; - sdk_OrthancPluginFindAnswers_Type.tp_init = (initproc) sdk_OrthancPluginFindAnswers_Constructor; - - - if (PyType_Ready(&sdk_OrthancPluginFindAnswers_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginFindAnswers"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - Py_INCREF(&sdk_OrthancPluginFindAnswers_Type); - if (PyModule_AddObject(module, "FindAnswers", (PyObject *)&sdk_OrthancPluginFindAnswers_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginFindAnswers"); - Py_DECREF(&sdk_OrthancPluginFindAnswers_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -} - - -PyTypeObject* GetOrthancPluginFindAnswersType() -{ - return &sdk_OrthancPluginFindAnswers_Type; -}
--- a/Sources/Autogenerated/sdk_OrthancPluginFindAnswers.methods.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Actual implementation of the methods -static PyObject *sdk_OrthancPluginFindAnswers_OrthancPluginFindAddAnswer( - sdk_OrthancPluginFindAnswers_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginFindAddAnswer() on object of class OrthancPluginFindAnswers"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - Py_buffer arg0; - - if (!PyArg_ParseTuple(args, "z*", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginFindAddAnswer(OrthancPlugins::GetGlobalContext(), self->object_, (arg0.len > 0 ? arg0.buf : NULL), (arg0.len > 0 ? arg0.len : 0)); - } - PyBuffer_Release(&arg0); - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject *sdk_OrthancPluginFindAnswers_OrthancPluginFindMarkIncomplete( - sdk_OrthancPluginFindAnswers_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginFindMarkIncomplete() on object of class OrthancPluginFindAnswers"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginFindMarkIncomplete(OrthancPlugins::GetGlobalContext(), self->object_); - } - - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} -
--- a/Sources/Autogenerated/sdk_OrthancPluginFindMatcher.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,138 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Forward declaration of the autogenerated methods -static PyObject *sdk_OrthancPluginFindMatcher_OrthancPluginFindMatcherIsMatch( - sdk_OrthancPluginFindMatcher_Object* self, PyObject *args); -// End of forward declarations - - -// Forward declaration of the custom methods -// End of forward declarations - - -static PyMethodDef sdk_OrthancPluginFindMatcher_Methods[] = { - { "FindMatcherIsMatch", - (PyCFunction) sdk_OrthancPluginFindMatcher_OrthancPluginFindMatcherIsMatch, METH_VARARGS, - "Generated from C function OrthancPluginFindMatcherIsMatch()" }, - { NULL } /* Sentinel */ -}; - - -static int sdk_OrthancPluginFindMatcher_Constructor( - sdk_OrthancPluginFindMatcher_Object *self, PyObject *args, PyObject *kwds) -{ - PythonLock::LogCall("Creating Python object of class OrthancPluginFindMatcher"); - - self->object_ = NULL; - self->borrowed_ = false; - - long long object = 0; - unsigned char borrowed = false; - - if (PyArg_ParseTuple(args, "Lb", &object, &borrowed)) - { - self->object_ = reinterpret_cast<OrthancPluginFindMatcher*>(static_cast<intptr_t>(object)); - self->borrowed_ = borrowed; - return 0; - } - else - { - PyErr_SetString(PyExc_ValueError, "Expected a pair (pointer, borrowed) in the constructor"); - return -1; - } -} - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginFindMatcher_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.FindMatcher", /* tp_name */ - sizeof(sdk_OrthancPluginFindMatcher_Object), /* tp_basicsize */ -}; - - -static void sdk_OrthancPluginFindMatcher_Destructor(PyObject *self) -{ - PythonLock::LogCall("Destroying Python object of class OrthancPluginFindMatcher"); - - sdk_OrthancPluginFindMatcher_Object& tmp = *((sdk_OrthancPluginFindMatcher_Object*) self); - - if (tmp.object_ != NULL && - !tmp.borrowed_) - { - OrthancPluginFreeFindMatcher(OrthancPlugins::GetGlobalContext(), tmp.object_); - tmp.object_ = NULL; - } - - Py_TYPE(self)->tp_free((PyObject *)self); -} - - -static void RegisterOrthancPluginFindMatcherClass(PyObject* module) -{ - sdk_OrthancPluginFindMatcher_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginFindMatcher_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginFindMatcher_Type.tp_doc = "Generated from Orthanc C class: OrthancPluginFindMatcher"; - sdk_OrthancPluginFindMatcher_Type.tp_methods = sdk_OrthancPluginFindMatcher_Methods; - sdk_OrthancPluginFindMatcher_Type.tp_init = (initproc) sdk_OrthancPluginFindMatcher_Constructor; - - /** - * "tp_dealloc is called when the reference count of the object goes - * down to zero. This is where you destroy the object and its - * members. It should then free the memory occupied by the object by - * calling tp_free." - * https://stackoverflow.com/a/24863227/881731 - **/ - sdk_OrthancPluginFindMatcher_Type.tp_dealloc = sdk_OrthancPluginFindMatcher_Destructor; - - if (PyType_Ready(&sdk_OrthancPluginFindMatcher_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginFindMatcher"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - Py_INCREF(&sdk_OrthancPluginFindMatcher_Type); - if (PyModule_AddObject(module, "FindMatcher", (PyObject *)&sdk_OrthancPluginFindMatcher_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginFindMatcher"); - Py_DECREF(&sdk_OrthancPluginFindMatcher_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -} - - -PyTypeObject* GetOrthancPluginFindMatcherType() -{ - return &sdk_OrthancPluginFindMatcher_Type; -}
--- a/Sources/Autogenerated/sdk_OrthancPluginFindMatcher.methods.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Actual implementation of the methods -static PyObject *sdk_OrthancPluginFindMatcher_OrthancPluginFindMatcherIsMatch( - sdk_OrthancPluginFindMatcher_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginFindMatcherIsMatch() on object of class OrthancPluginFindMatcher"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - Py_buffer arg0; - - if (!PyArg_ParseTuple(args, "z*", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - long value; - { - PythonThreadsAllower allower; - value = OrthancPluginFindMatcherIsMatch(OrthancPlugins::GetGlobalContext(), self->object_, (arg0.len > 0 ? arg0.buf : NULL), (arg0.len > 0 ? arg0.len : 0)); - } - PyBuffer_Release(&arg0); - return PyLong_FromLong(value); -} -
--- a/Sources/Autogenerated/sdk_OrthancPluginFindQuery.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,133 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Forward declaration of the autogenerated methods -static PyObject *sdk_OrthancPluginFindQuery_OrthancPluginGetFindQuerySize( - sdk_OrthancPluginFindQuery_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginFindQuery_OrthancPluginGetFindQueryTagName( - sdk_OrthancPluginFindQuery_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginFindQuery_OrthancPluginGetFindQueryValue( - sdk_OrthancPluginFindQuery_Object* self, PyObject *args); -// End of forward declarations - - -// Forward declaration of the custom methods -extern PyObject *GetFindQueryTagElement(sdk_OrthancPluginFindQuery_Object* self, PyObject *args); -extern PyObject *GetFindQueryTagGroup(sdk_OrthancPluginFindQuery_Object* self, PyObject *args); -// End of forward declarations - - -static PyMethodDef sdk_OrthancPluginFindQuery_Methods[] = { - { "GetFindQuerySize", - (PyCFunction) sdk_OrthancPluginFindQuery_OrthancPluginGetFindQuerySize, METH_VARARGS, - "Generated from C function OrthancPluginGetFindQuerySize()" }, - { "GetFindQueryTagName", - (PyCFunction) sdk_OrthancPluginFindQuery_OrthancPluginGetFindQueryTagName, METH_VARARGS, - "Generated from C function OrthancPluginGetFindQueryTagName()" }, - { "GetFindQueryValue", - (PyCFunction) sdk_OrthancPluginFindQuery_OrthancPluginGetFindQueryValue, METH_VARARGS, - "Generated from C function OrthancPluginGetFindQueryValue()" }, - { "GetFindQueryTagElement", - (PyCFunction) GetFindQueryTagElement, METH_VARARGS, - "Implemented in C++ function GetFindQueryTagElement()" }, - { "GetFindQueryTagGroup", - (PyCFunction) GetFindQueryTagGroup, METH_VARARGS, - "Implemented in C++ function GetFindQueryTagGroup()" }, - { NULL } /* Sentinel */ -}; - - -static int sdk_OrthancPluginFindQuery_Constructor( - sdk_OrthancPluginFindQuery_Object *self, PyObject *args, PyObject *kwds) -{ - PythonLock::LogCall("Creating Python object of class OrthancPluginFindQuery"); - - self->object_ = NULL; - self->borrowed_ = false; - - long long object = 0; - unsigned char borrowed = false; - - if (PyArg_ParseTuple(args, "Lb", &object, &borrowed)) - { - self->object_ = reinterpret_cast<OrthancPluginFindQuery*>(static_cast<intptr_t>(object)); - self->borrowed_ = borrowed; - return 0; - } - else - { - PyErr_SetString(PyExc_ValueError, "Expected a pair (pointer, borrowed) in the constructor"); - return -1; - } -} - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginFindQuery_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.FindQuery", /* tp_name */ - sizeof(sdk_OrthancPluginFindQuery_Object), /* tp_basicsize */ -}; - - - - -static void RegisterOrthancPluginFindQueryClass(PyObject* module) -{ - sdk_OrthancPluginFindQuery_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginFindQuery_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginFindQuery_Type.tp_doc = "Generated from Orthanc C class: OrthancPluginFindQuery"; - sdk_OrthancPluginFindQuery_Type.tp_methods = sdk_OrthancPluginFindQuery_Methods; - sdk_OrthancPluginFindQuery_Type.tp_init = (initproc) sdk_OrthancPluginFindQuery_Constructor; - - - if (PyType_Ready(&sdk_OrthancPluginFindQuery_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginFindQuery"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - Py_INCREF(&sdk_OrthancPluginFindQuery_Type); - if (PyModule_AddObject(module, "FindQuery", (PyObject *)&sdk_OrthancPluginFindQuery_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginFindQuery"); - Py_DECREF(&sdk_OrthancPluginFindQuery_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -} - - -PyTypeObject* GetOrthancPluginFindQueryType() -{ - return &sdk_OrthancPluginFindQuery_Type; -}
--- a/Sources/Autogenerated/sdk_OrthancPluginFindQuery.methods.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,124 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Actual implementation of the methods -static PyObject *sdk_OrthancPluginFindQuery_OrthancPluginGetFindQuerySize( - sdk_OrthancPluginFindQuery_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetFindQuerySize() on object of class OrthancPluginFindQuery"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - - long value; - { - PythonThreadsAllower allower; - value = OrthancPluginGetFindQuerySize(OrthancPlugins::GetGlobalContext(), self->object_); - } - - return PyLong_FromLong(value); -} - -static PyObject *sdk_OrthancPluginFindQuery_OrthancPluginGetFindQueryTagName( - sdk_OrthancPluginFindQuery_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetFindQueryTagName() on object of class OrthancPluginFindQuery"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - unsigned long arg0 = 0; - - if (!PyArg_ParseTuple(args, "k", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - OrthancPlugins::OrthancString s; - { - PythonThreadsAllower allower; - s.Assign(OrthancPluginGetFindQueryTagName(OrthancPlugins::GetGlobalContext(), self->object_, arg0)); - } - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} - -static PyObject *sdk_OrthancPluginFindQuery_OrthancPluginGetFindQueryValue( - sdk_OrthancPluginFindQuery_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetFindQueryValue() on object of class OrthancPluginFindQuery"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - unsigned long arg0 = 0; - - if (!PyArg_ParseTuple(args, "k", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - OrthancPlugins::OrthancString s; - { - PythonThreadsAllower allower; - s.Assign(OrthancPluginGetFindQueryValue(OrthancPlugins::GetGlobalContext(), self->object_, arg0)); - } - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} -
--- a/Sources/Autogenerated/sdk_OrthancPluginHttpAuthenticationStatus.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginHttpAuthenticationStatus_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginHttpAuthenticationStatus_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.HttpAuthenticationStatus", /* tp_name */ - sizeof(sdk_OrthancPluginHttpAuthenticationStatus_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginHttpAuthenticationStatusEnumeration(PyObject* module) -{ - sdk_OrthancPluginHttpAuthenticationStatus_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginHttpAuthenticationStatus_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginHttpAuthenticationStatus_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginHttpAuthenticationStatus"; - - sdk_OrthancPluginHttpAuthenticationStatus_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginHttpAuthenticationStatus_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginHttpAuthenticationStatus"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(0); - PyDict_SetItemString(sdk_OrthancPluginHttpAuthenticationStatus_Type.tp_dict, "GRANTED", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginHttpAuthenticationStatus_Type.tp_dict, "UNAUTHORIZED", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2); - PyDict_SetItemString(sdk_OrthancPluginHttpAuthenticationStatus_Type.tp_dict, "FORBIDDEN", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(3); - PyDict_SetItemString(sdk_OrthancPluginHttpAuthenticationStatus_Type.tp_dict, "REDIRECT", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginHttpAuthenticationStatus_Type); - if (PyModule_AddObject(module, "HttpAuthenticationStatus", (PyObject *)&sdk_OrthancPluginHttpAuthenticationStatus_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginHttpAuthenticationStatus"); - Py_DECREF(&sdk_OrthancPluginHttpAuthenticationStatus_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginHttpMethod.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginHttpMethod_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginHttpMethod_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.HttpMethod", /* tp_name */ - sizeof(sdk_OrthancPluginHttpMethod_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginHttpMethodEnumeration(PyObject* module) -{ - sdk_OrthancPluginHttpMethod_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginHttpMethod_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginHttpMethod_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginHttpMethod"; - - sdk_OrthancPluginHttpMethod_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginHttpMethod_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginHttpMethod"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginHttpMethod_Type.tp_dict, "GET", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2); - PyDict_SetItemString(sdk_OrthancPluginHttpMethod_Type.tp_dict, "POST", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(3); - PyDict_SetItemString(sdk_OrthancPluginHttpMethod_Type.tp_dict, "PUT", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(4); - PyDict_SetItemString(sdk_OrthancPluginHttpMethod_Type.tp_dict, "DELETE", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginHttpMethod_Type); - if (PyModule_AddObject(module, "HttpMethod", (PyObject *)&sdk_OrthancPluginHttpMethod_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginHttpMethod"); - Py_DECREF(&sdk_OrthancPluginHttpMethod_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginIdentifierConstraint.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginIdentifierConstraint_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginIdentifierConstraint_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.IdentifierConstraint", /* tp_name */ - sizeof(sdk_OrthancPluginIdentifierConstraint_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginIdentifierConstraintEnumeration(PyObject* module) -{ - sdk_OrthancPluginIdentifierConstraint_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginIdentifierConstraint_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginIdentifierConstraint_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginIdentifierConstraint"; - - sdk_OrthancPluginIdentifierConstraint_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginIdentifierConstraint_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginIdentifierConstraint"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginIdentifierConstraint_Type.tp_dict, "EQUAL", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2); - PyDict_SetItemString(sdk_OrthancPluginIdentifierConstraint_Type.tp_dict, "SMALLER_OR_EQUAL", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(3); - PyDict_SetItemString(sdk_OrthancPluginIdentifierConstraint_Type.tp_dict, "GREATER_OR_EQUAL", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(4); - PyDict_SetItemString(sdk_OrthancPluginIdentifierConstraint_Type.tp_dict, "WILDCARD", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginIdentifierConstraint_Type); - if (PyModule_AddObject(module, "IdentifierConstraint", (PyObject *)&sdk_OrthancPluginIdentifierConstraint_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginIdentifierConstraint"); - Py_DECREF(&sdk_OrthancPluginIdentifierConstraint_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginImage.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,167 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Forward declaration of the autogenerated methods -static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImagePixelFormat( - sdk_OrthancPluginImage_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImageWidth( - sdk_OrthancPluginImage_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImageHeight( - sdk_OrthancPluginImage_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImagePitch( - sdk_OrthancPluginImage_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginImage_OrthancPluginConvertPixelFormat( - sdk_OrthancPluginImage_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginImage_OrthancPluginDrawText( - sdk_OrthancPluginImage_Object* self, PyObject *args); -// End of forward declarations - - -// Forward declaration of the custom methods -extern PyObject *GetImageBuffer(sdk_OrthancPluginImage_Object* self, PyObject *args); -// End of forward declarations - - -static PyMethodDef sdk_OrthancPluginImage_Methods[] = { - { "GetImagePixelFormat", - (PyCFunction) sdk_OrthancPluginImage_OrthancPluginGetImagePixelFormat, METH_VARARGS, - "Generated from C function OrthancPluginGetImagePixelFormat()" }, - { "GetImageWidth", - (PyCFunction) sdk_OrthancPluginImage_OrthancPluginGetImageWidth, METH_VARARGS, - "Generated from C function OrthancPluginGetImageWidth()" }, - { "GetImageHeight", - (PyCFunction) sdk_OrthancPluginImage_OrthancPluginGetImageHeight, METH_VARARGS, - "Generated from C function OrthancPluginGetImageHeight()" }, - { "GetImagePitch", - (PyCFunction) sdk_OrthancPluginImage_OrthancPluginGetImagePitch, METH_VARARGS, - "Generated from C function OrthancPluginGetImagePitch()" }, - { "ConvertPixelFormat", - (PyCFunction) sdk_OrthancPluginImage_OrthancPluginConvertPixelFormat, METH_VARARGS, - "Generated from C function OrthancPluginConvertPixelFormat()" }, - { "DrawText", - (PyCFunction) sdk_OrthancPluginImage_OrthancPluginDrawText, METH_VARARGS, - "Generated from C function OrthancPluginDrawText()" }, - { "GetImageBuffer", - (PyCFunction) GetImageBuffer, METH_VARARGS, - "Implemented in C++ function GetImageBuffer()" }, - { NULL } /* Sentinel */ -}; - - -static int sdk_OrthancPluginImage_Constructor( - sdk_OrthancPluginImage_Object *self, PyObject *args, PyObject *kwds) -{ - PythonLock::LogCall("Creating Python object of class OrthancPluginImage"); - - self->object_ = NULL; - self->borrowed_ = false; - - long long object = 0; - unsigned char borrowed = false; - - if (PyArg_ParseTuple(args, "Lb", &object, &borrowed)) - { - self->object_ = reinterpret_cast<OrthancPluginImage*>(static_cast<intptr_t>(object)); - self->borrowed_ = borrowed; - return 0; - } - else - { - PyErr_SetString(PyExc_ValueError, "Expected a pair (pointer, borrowed) in the constructor"); - return -1; - } -} - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginImage_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.Image", /* tp_name */ - sizeof(sdk_OrthancPluginImage_Object), /* tp_basicsize */ -}; - - -static void sdk_OrthancPluginImage_Destructor(PyObject *self) -{ - PythonLock::LogCall("Destroying Python object of class OrthancPluginImage"); - - sdk_OrthancPluginImage_Object& tmp = *((sdk_OrthancPluginImage_Object*) self); - - if (tmp.object_ != NULL && - !tmp.borrowed_) - { - OrthancPluginFreeImage(OrthancPlugins::GetGlobalContext(), tmp.object_); - tmp.object_ = NULL; - } - - Py_TYPE(self)->tp_free((PyObject *)self); -} - - -static void RegisterOrthancPluginImageClass(PyObject* module) -{ - sdk_OrthancPluginImage_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginImage_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginImage_Type.tp_doc = "Generated from Orthanc C class: OrthancPluginImage"; - sdk_OrthancPluginImage_Type.tp_methods = sdk_OrthancPluginImage_Methods; - sdk_OrthancPluginImage_Type.tp_init = (initproc) sdk_OrthancPluginImage_Constructor; - - /** - * "tp_dealloc is called when the reference count of the object goes - * down to zero. This is where you destroy the object and its - * members. It should then free the memory occupied by the object by - * calling tp_free." - * https://stackoverflow.com/a/24863227/881731 - **/ - sdk_OrthancPluginImage_Type.tp_dealloc = sdk_OrthancPluginImage_Destructor; - - if (PyType_Ready(&sdk_OrthancPluginImage_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginImage"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - Py_INCREF(&sdk_OrthancPluginImage_Type); - if (PyModule_AddObject(module, "Image", (PyObject *)&sdk_OrthancPluginImage_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginImage"); - Py_DECREF(&sdk_OrthancPluginImage_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -} - - -PyTypeObject* GetOrthancPluginImageType() -{ - return &sdk_OrthancPluginImage_Type; -}
--- a/Sources/Autogenerated/sdk_OrthancPluginImage.methods.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,202 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Actual implementation of the methods -static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImagePixelFormat( - sdk_OrthancPluginImage_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetImagePixelFormat() on object of class OrthancPluginImage"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - - OrthancPluginPixelFormat value; - { - PythonThreadsAllower allower; - value = OrthancPluginGetImagePixelFormat(OrthancPlugins::GetGlobalContext(), self->object_); - } - - return PyLong_FromLong(value); -} - -static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImageWidth( - sdk_OrthancPluginImage_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetImageWidth() on object of class OrthancPluginImage"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - - long value; - { - PythonThreadsAllower allower; - value = OrthancPluginGetImageWidth(OrthancPlugins::GetGlobalContext(), self->object_); - } - - return PyLong_FromLong(value); -} - -static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImageHeight( - sdk_OrthancPluginImage_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetImageHeight() on object of class OrthancPluginImage"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - - long value; - { - PythonThreadsAllower allower; - value = OrthancPluginGetImageHeight(OrthancPlugins::GetGlobalContext(), self->object_); - } - - return PyLong_FromLong(value); -} - -static PyObject *sdk_OrthancPluginImage_OrthancPluginGetImagePitch( - sdk_OrthancPluginImage_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetImagePitch() on object of class OrthancPluginImage"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - - long value; - { - PythonThreadsAllower allower; - value = OrthancPluginGetImagePitch(OrthancPlugins::GetGlobalContext(), self->object_); - } - - return PyLong_FromLong(value); -} - -static PyObject *sdk_OrthancPluginImage_OrthancPluginConvertPixelFormat( - sdk_OrthancPluginImage_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginConvertPixelFormat() on object of class OrthancPluginImage"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - long int arg0 = 0; - - if (!PyArg_ParseTuple(args, "l", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - // This is the case of a constructor - OrthancPluginImage* obj; - { - PythonThreadsAllower allower; - obj = OrthancPluginConvertPixelFormat(OrthancPlugins::GetGlobalContext(), self->object_, static_cast<OrthancPluginPixelFormat>(arg0)); - } - - if (obj == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - PyObject *argList = Py_BuildValue("Lb", obj, false /* not borrowed */); - PyObject *python = PyObject_CallObject((PyObject *) &sdk_OrthancPluginImage_Type, argList); - Py_DECREF(argList); - return python; - } -} - -static PyObject *sdk_OrthancPluginImage_OrthancPluginDrawText( - sdk_OrthancPluginImage_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginDrawText() on object of class OrthancPluginImage"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - unsigned long arg0 = 0; - const char* arg1 = NULL; - long int arg2 = 0; - long int arg3 = 0; - unsigned char arg4 = 0; - unsigned char arg5 = 0; - unsigned char arg6 = 0; - - if (!PyArg_ParseTuple(args, "ksllbbb", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (7 arguments expected)"); - return NULL; - } - - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginDrawText(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1, arg2, arg3, arg4, arg5, arg6); - } - - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} -
--- a/Sources/Autogenerated/sdk_OrthancPluginImageFormat.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginImageFormat_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginImageFormat_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.ImageFormat", /* tp_name */ - sizeof(sdk_OrthancPluginImageFormat_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginImageFormatEnumeration(PyObject* module) -{ - sdk_OrthancPluginImageFormat_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginImageFormat_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginImageFormat_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginImageFormat"; - - sdk_OrthancPluginImageFormat_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginImageFormat_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginImageFormat"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(0); - PyDict_SetItemString(sdk_OrthancPluginImageFormat_Type.tp_dict, "PNG", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginImageFormat_Type.tp_dict, "JPEG", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2); - PyDict_SetItemString(sdk_OrthancPluginImageFormat_Type.tp_dict, "DICOM", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginImageFormat_Type); - if (PyModule_AddObject(module, "ImageFormat", (PyObject *)&sdk_OrthancPluginImageFormat_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginImageFormat"); - Py_DECREF(&sdk_OrthancPluginImageFormat_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginInstanceOrigin.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,120 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginInstanceOrigin_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginInstanceOrigin_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.InstanceOrigin", /* tp_name */ - sizeof(sdk_OrthancPluginInstanceOrigin_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginInstanceOriginEnumeration(PyObject* module) -{ - sdk_OrthancPluginInstanceOrigin_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginInstanceOrigin_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginInstanceOrigin_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginInstanceOrigin"; - - sdk_OrthancPluginInstanceOrigin_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginInstanceOrigin_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginInstanceOrigin"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginInstanceOrigin_Type.tp_dict, "UNKNOWN", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2); - PyDict_SetItemString(sdk_OrthancPluginInstanceOrigin_Type.tp_dict, "DICOM_PROTOCOL", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(3); - PyDict_SetItemString(sdk_OrthancPluginInstanceOrigin_Type.tp_dict, "REST_API", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(4); - PyDict_SetItemString(sdk_OrthancPluginInstanceOrigin_Type.tp_dict, "PLUGIN", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(5); - PyDict_SetItemString(sdk_OrthancPluginInstanceOrigin_Type.tp_dict, "LUA", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(6); - PyDict_SetItemString(sdk_OrthancPluginInstanceOrigin_Type.tp_dict, "WEB_DAV", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginInstanceOrigin_Type); - if (PyModule_AddObject(module, "InstanceOrigin", (PyObject *)&sdk_OrthancPluginInstanceOrigin_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginInstanceOrigin"); - Py_DECREF(&sdk_OrthancPluginInstanceOrigin_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginJob.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,138 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Forward declaration of the autogenerated methods -static PyObject *sdk_OrthancPluginJob_OrthancPluginSubmitJob( - sdk_OrthancPluginJob_Object* self, PyObject *args); -// End of forward declarations - - -// Forward declaration of the custom methods -// End of forward declarations - - -static PyMethodDef sdk_OrthancPluginJob_Methods[] = { - { "SubmitJob", - (PyCFunction) sdk_OrthancPluginJob_OrthancPluginSubmitJob, METH_VARARGS, - "Generated from C function OrthancPluginSubmitJob()" }, - { NULL } /* Sentinel */ -}; - - -static int sdk_OrthancPluginJob_Constructor( - sdk_OrthancPluginJob_Object *self, PyObject *args, PyObject *kwds) -{ - PythonLock::LogCall("Creating Python object of class OrthancPluginJob"); - - self->object_ = NULL; - self->borrowed_ = false; - - long long object = 0; - unsigned char borrowed = false; - - if (PyArg_ParseTuple(args, "Lb", &object, &borrowed)) - { - self->object_ = reinterpret_cast<OrthancPluginJob*>(static_cast<intptr_t>(object)); - self->borrowed_ = borrowed; - return 0; - } - else - { - PyErr_SetString(PyExc_ValueError, "Expected a pair (pointer, borrowed) in the constructor"); - return -1; - } -} - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginJob_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.Job", /* tp_name */ - sizeof(sdk_OrthancPluginJob_Object), /* tp_basicsize */ -}; - - -static void sdk_OrthancPluginJob_Destructor(PyObject *self) -{ - PythonLock::LogCall("Destroying Python object of class OrthancPluginJob"); - - sdk_OrthancPluginJob_Object& tmp = *((sdk_OrthancPluginJob_Object*) self); - - if (tmp.object_ != NULL && - !tmp.borrowed_) - { - OrthancPluginFreeJob(OrthancPlugins::GetGlobalContext(), tmp.object_); - tmp.object_ = NULL; - } - - Py_TYPE(self)->tp_free((PyObject *)self); -} - - -static void RegisterOrthancPluginJobClass(PyObject* module) -{ - sdk_OrthancPluginJob_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginJob_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginJob_Type.tp_doc = "Generated from Orthanc C class: OrthancPluginJob"; - sdk_OrthancPluginJob_Type.tp_methods = sdk_OrthancPluginJob_Methods; - sdk_OrthancPluginJob_Type.tp_init = (initproc) sdk_OrthancPluginJob_Constructor; - - /** - * "tp_dealloc is called when the reference count of the object goes - * down to zero. This is where you destroy the object and its - * members. It should then free the memory occupied by the object by - * calling tp_free." - * https://stackoverflow.com/a/24863227/881731 - **/ - sdk_OrthancPluginJob_Type.tp_dealloc = sdk_OrthancPluginJob_Destructor; - - if (PyType_Ready(&sdk_OrthancPluginJob_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginJob"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - Py_INCREF(&sdk_OrthancPluginJob_Type); - if (PyModule_AddObject(module, "Job", (PyObject *)&sdk_OrthancPluginJob_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginJob"); - Py_DECREF(&sdk_OrthancPluginJob_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -} - - -PyTypeObject* GetOrthancPluginJobType() -{ - return &sdk_OrthancPluginJob_Type; -}
--- a/Sources/Autogenerated/sdk_OrthancPluginJob.methods.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Actual implementation of the methods -static PyObject *sdk_OrthancPluginJob_OrthancPluginSubmitJob( - sdk_OrthancPluginJob_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginSubmitJob() on object of class OrthancPluginJob"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - long int arg0 = 0; - - if (!PyArg_ParseTuple(args, "l", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - OrthancPlugins::OrthancString s; - { - PythonThreadsAllower allower; - s.Assign(OrthancPluginSubmitJob(OrthancPlugins::GetGlobalContext(), self->object_, arg0)); - } - - if (s.GetContent() == NULL) - { - PythonLock::RaiseException(OrthancPluginErrorCode_InternalError); - return NULL; - } - else - { - return PyUnicode_FromString(s.GetContent()); - } -} -
--- a/Sources/Autogenerated/sdk_OrthancPluginJobStepStatus.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginJobStepStatus_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginJobStepStatus_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.JobStepStatus", /* tp_name */ - sizeof(sdk_OrthancPluginJobStepStatus_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginJobStepStatusEnumeration(PyObject* module) -{ - sdk_OrthancPluginJobStepStatus_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginJobStepStatus_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginJobStepStatus_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginJobStepStatus"; - - sdk_OrthancPluginJobStepStatus_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginJobStepStatus_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginJobStepStatus"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginJobStepStatus_Type.tp_dict, "SUCCESS", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2); - PyDict_SetItemString(sdk_OrthancPluginJobStepStatus_Type.tp_dict, "FAILURE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(3); - PyDict_SetItemString(sdk_OrthancPluginJobStepStatus_Type.tp_dict, "CONTINUE", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginJobStepStatus_Type); - if (PyModule_AddObject(module, "JobStepStatus", (PyObject *)&sdk_OrthancPluginJobStepStatus_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginJobStepStatus"); - Py_DECREF(&sdk_OrthancPluginJobStepStatus_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginJobStopReason.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginJobStopReason_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginJobStopReason_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.JobStopReason", /* tp_name */ - sizeof(sdk_OrthancPluginJobStopReason_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginJobStopReasonEnumeration(PyObject* module) -{ - sdk_OrthancPluginJobStopReason_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginJobStopReason_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginJobStopReason_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginJobStopReason"; - - sdk_OrthancPluginJobStopReason_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginJobStopReason_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginJobStopReason"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginJobStopReason_Type.tp_dict, "SUCCESS", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2); - PyDict_SetItemString(sdk_OrthancPluginJobStopReason_Type.tp_dict, "PAUSED", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(3); - PyDict_SetItemString(sdk_OrthancPluginJobStopReason_Type.tp_dict, "FAILURE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(4); - PyDict_SetItemString(sdk_OrthancPluginJobStopReason_Type.tp_dict, "CANCELED", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginJobStopReason_Type); - if (PyModule_AddObject(module, "JobStopReason", (PyObject *)&sdk_OrthancPluginJobStopReason_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginJobStopReason"); - Py_DECREF(&sdk_OrthancPluginJobStopReason_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginKeysValuesIterator.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,143 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Forward declaration of the autogenerated methods -static PyObject *sdk_OrthancPluginKeysValuesIterator_OrthancPluginKeysValuesIteratorGetKey( - sdk_OrthancPluginKeysValuesIterator_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginKeysValuesIterator_OrthancPluginKeysValuesIteratorGetValue( - sdk_OrthancPluginKeysValuesIterator_Object* self, PyObject *args); -// End of forward declarations - - -// Forward declaration of the custom methods -// End of forward declarations - - -static PyMethodDef sdk_OrthancPluginKeysValuesIterator_Methods[] = { - { "KeysValuesIteratorGetKey", - (PyCFunction) sdk_OrthancPluginKeysValuesIterator_OrthancPluginKeysValuesIteratorGetKey, METH_VARARGS, - "Generated from C function OrthancPluginKeysValuesIteratorGetKey()" }, - { "KeysValuesIteratorGetValue", - (PyCFunction) sdk_OrthancPluginKeysValuesIterator_OrthancPluginKeysValuesIteratorGetValue, METH_VARARGS, - "Generated from C function OrthancPluginKeysValuesIteratorGetValue()" }, - { NULL } /* Sentinel */ -}; - - -static int sdk_OrthancPluginKeysValuesIterator_Constructor( - sdk_OrthancPluginKeysValuesIterator_Object *self, PyObject *args, PyObject *kwds) -{ - PythonLock::LogCall("Creating Python object of class OrthancPluginKeysValuesIterator"); - - self->object_ = NULL; - self->borrowed_ = false; - - long long object = 0; - unsigned char borrowed = false; - - if (PyArg_ParseTuple(args, "Lb", &object, &borrowed)) - { - self->object_ = reinterpret_cast<OrthancPluginKeysValuesIterator*>(static_cast<intptr_t>(object)); - self->borrowed_ = borrowed; - return 0; - } - else - { - PyErr_SetString(PyExc_ValueError, "Expected a pair (pointer, borrowed) in the constructor"); - return -1; - } -} - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginKeysValuesIterator_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.KeysValuesIterator", /* tp_name */ - sizeof(sdk_OrthancPluginKeysValuesIterator_Object), /* tp_basicsize */ -}; - - -static void sdk_OrthancPluginKeysValuesIterator_Destructor(PyObject *self) -{ - PythonLock::LogCall("Destroying Python object of class OrthancPluginKeysValuesIterator"); - - sdk_OrthancPluginKeysValuesIterator_Object& tmp = *((sdk_OrthancPluginKeysValuesIterator_Object*) self); - - if (tmp.object_ != NULL && - !tmp.borrowed_) - { - OrthancPluginFreeKeysValuesIterator(OrthancPlugins::GetGlobalContext(), tmp.object_); - tmp.object_ = NULL; - } - - Py_TYPE(self)->tp_free((PyObject *)self); -} - - -static void RegisterOrthancPluginKeysValuesIteratorClass(PyObject* module) -{ - sdk_OrthancPluginKeysValuesIterator_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginKeysValuesIterator_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginKeysValuesIterator_Type.tp_doc = "Generated from Orthanc C class: OrthancPluginKeysValuesIterator"; - sdk_OrthancPluginKeysValuesIterator_Type.tp_methods = sdk_OrthancPluginKeysValuesIterator_Methods; - sdk_OrthancPluginKeysValuesIterator_Type.tp_init = (initproc) sdk_OrthancPluginKeysValuesIterator_Constructor; - - /** - * "tp_dealloc is called when the reference count of the object goes - * down to zero. This is where you destroy the object and its - * members. It should then free the memory occupied by the object by - * calling tp_free." - * https://stackoverflow.com/a/24863227/881731 - **/ - sdk_OrthancPluginKeysValuesIterator_Type.tp_dealloc = sdk_OrthancPluginKeysValuesIterator_Destructor; - - if (PyType_Ready(&sdk_OrthancPluginKeysValuesIterator_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginKeysValuesIterator"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - Py_INCREF(&sdk_OrthancPluginKeysValuesIterator_Type); - if (PyModule_AddObject(module, "KeysValuesIterator", (PyObject *)&sdk_OrthancPluginKeysValuesIterator_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginKeysValuesIterator"); - Py_DECREF(&sdk_OrthancPluginKeysValuesIterator_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -} - - -PyTypeObject* GetOrthancPluginKeysValuesIteratorType() -{ - return &sdk_OrthancPluginKeysValuesIterator_Type; -}
--- a/Sources/Autogenerated/sdk_OrthancPluginKeysValuesIterator.methods.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Actual implementation of the methods -static PyObject *sdk_OrthancPluginKeysValuesIterator_OrthancPluginKeysValuesIteratorGetKey( - sdk_OrthancPluginKeysValuesIterator_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginKeysValuesIteratorGetKey() on object of class OrthancPluginKeysValuesIterator"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - - const char* s; - { - PythonThreadsAllower allower; - s = OrthancPluginKeysValuesIteratorGetKey(OrthancPlugins::GetGlobalContext(), self->object_); - } - - if (s == NULL) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - return PyUnicode_FromString(s); - } -} - -static PyObject *sdk_OrthancPluginKeysValuesIterator_OrthancPluginKeysValuesIteratorGetValue( - sdk_OrthancPluginKeysValuesIterator_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginKeysValuesIteratorGetValue() on object of class OrthancPluginKeysValuesIterator"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - - OrthancPlugins::MemoryBuffer buffer; - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginKeysValuesIteratorGetValue(OrthancPlugins::GetGlobalContext(), *buffer, self->object_); - } - - if (code == OrthancPluginErrorCode_Success) - { - return PyBytes_FromStringAndSize(reinterpret_cast<const char*>(buffer.GetData()), buffer.GetSize()); - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} -
--- a/Sources/Autogenerated/sdk_OrthancPluginLoadDicomInstanceMode.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginLoadDicomInstanceMode_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginLoadDicomInstanceMode_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.LoadDicomInstanceMode", /* tp_name */ - sizeof(sdk_OrthancPluginLoadDicomInstanceMode_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginLoadDicomInstanceModeEnumeration(PyObject* module) -{ - sdk_OrthancPluginLoadDicomInstanceMode_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginLoadDicomInstanceMode_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginLoadDicomInstanceMode_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginLoadDicomInstanceMode"; - - sdk_OrthancPluginLoadDicomInstanceMode_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginLoadDicomInstanceMode_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginLoadDicomInstanceMode"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginLoadDicomInstanceMode_Type.tp_dict, "WHOLE_DICOM", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2); - PyDict_SetItemString(sdk_OrthancPluginLoadDicomInstanceMode_Type.tp_dict, "UNTIL_PIXEL_DATA", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(3); - PyDict_SetItemString(sdk_OrthancPluginLoadDicomInstanceMode_Type.tp_dict, "EMPTY_PIXEL_DATA", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginLoadDicomInstanceMode_Type); - if (PyModule_AddObject(module, "LoadDicomInstanceMode", (PyObject *)&sdk_OrthancPluginLoadDicomInstanceMode_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginLoadDicomInstanceMode"); - Py_DECREF(&sdk_OrthancPluginLoadDicomInstanceMode_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginLogCategory.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,126 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginLogCategory_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginLogCategory_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.LogCategory", /* tp_name */ - sizeof(sdk_OrthancPluginLogCategory_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginLogCategoryEnumeration(PyObject* module) -{ - sdk_OrthancPluginLogCategory_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginLogCategory_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginLogCategory_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginLogCategory"; - - sdk_OrthancPluginLogCategory_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginLogCategory_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginLogCategory"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginLogCategory_Type.tp_dict, "GENERIC", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2); - PyDict_SetItemString(sdk_OrthancPluginLogCategory_Type.tp_dict, "PLUGINS", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(4); - PyDict_SetItemString(sdk_OrthancPluginLogCategory_Type.tp_dict, "HTTP", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(8); - PyDict_SetItemString(sdk_OrthancPluginLogCategory_Type.tp_dict, "SQLITE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(16); - PyDict_SetItemString(sdk_OrthancPluginLogCategory_Type.tp_dict, "DICOM", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(32); - PyDict_SetItemString(sdk_OrthancPluginLogCategory_Type.tp_dict, "JOBS", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(64); - PyDict_SetItemString(sdk_OrthancPluginLogCategory_Type.tp_dict, "LUA", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginLogCategory_Type); - if (PyModule_AddObject(module, "LogCategory", (PyObject *)&sdk_OrthancPluginLogCategory_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginLogCategory"); - Py_DECREF(&sdk_OrthancPluginLogCategory_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginLogLevel.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginLogLevel_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginLogLevel_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.LogLevel", /* tp_name */ - sizeof(sdk_OrthancPluginLogLevel_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginLogLevelEnumeration(PyObject* module) -{ - sdk_OrthancPluginLogLevel_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginLogLevel_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginLogLevel_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginLogLevel"; - - sdk_OrthancPluginLogLevel_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginLogLevel_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginLogLevel"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(0); - PyDict_SetItemString(sdk_OrthancPluginLogLevel_Type.tp_dict, "ERROR", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginLogLevel_Type.tp_dict, "WARNING", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2); - PyDict_SetItemString(sdk_OrthancPluginLogLevel_Type.tp_dict, "INFO", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(3); - PyDict_SetItemString(sdk_OrthancPluginLogLevel_Type.tp_dict, "TRACE", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginLogLevel_Type); - if (PyModule_AddObject(module, "LogLevel", (PyObject *)&sdk_OrthancPluginLogLevel_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginLogLevel"); - Py_DECREF(&sdk_OrthancPluginLogLevel_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginMetricsType.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginMetricsType_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginMetricsType_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.MetricsType", /* tp_name */ - sizeof(sdk_OrthancPluginMetricsType_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginMetricsTypeEnumeration(PyObject* module) -{ - sdk_OrthancPluginMetricsType_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginMetricsType_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginMetricsType_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginMetricsType"; - - sdk_OrthancPluginMetricsType_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginMetricsType_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginMetricsType"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(0); - PyDict_SetItemString(sdk_OrthancPluginMetricsType_Type.tp_dict, "DEFAULT", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginMetricsType_Type.tp_dict, "TIMER", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginMetricsType_Type); - if (PyModule_AddObject(module, "MetricsType", (PyObject *)&sdk_OrthancPluginMetricsType_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginMetricsType"); - Py_DECREF(&sdk_OrthancPluginMetricsType_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginPeers.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,153 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Forward declaration of the autogenerated methods -static PyObject *sdk_OrthancPluginPeers_OrthancPluginGetPeersCount( - sdk_OrthancPluginPeers_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginPeers_OrthancPluginGetPeerName( - sdk_OrthancPluginPeers_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginPeers_OrthancPluginGetPeerUrl( - sdk_OrthancPluginPeers_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginPeers_OrthancPluginGetPeerUserProperty( - sdk_OrthancPluginPeers_Object* self, PyObject *args); -// End of forward declarations - - -// Forward declaration of the custom methods -// End of forward declarations - - -static PyMethodDef sdk_OrthancPluginPeers_Methods[] = { - { "GetPeersCount", - (PyCFunction) sdk_OrthancPluginPeers_OrthancPluginGetPeersCount, METH_VARARGS, - "Generated from C function OrthancPluginGetPeersCount()" }, - { "GetPeerName", - (PyCFunction) sdk_OrthancPluginPeers_OrthancPluginGetPeerName, METH_VARARGS, - "Generated from C function OrthancPluginGetPeerName()" }, - { "GetPeerUrl", - (PyCFunction) sdk_OrthancPluginPeers_OrthancPluginGetPeerUrl, METH_VARARGS, - "Generated from C function OrthancPluginGetPeerUrl()" }, - { "GetPeerUserProperty", - (PyCFunction) sdk_OrthancPluginPeers_OrthancPluginGetPeerUserProperty, METH_VARARGS, - "Generated from C function OrthancPluginGetPeerUserProperty()" }, - { NULL } /* Sentinel */ -}; - - -static int sdk_OrthancPluginPeers_Constructor( - sdk_OrthancPluginPeers_Object *self, PyObject *args, PyObject *kwds) -{ - PythonLock::LogCall("Creating Python object of class OrthancPluginPeers"); - - self->object_ = NULL; - self->borrowed_ = false; - - long long object = 0; - unsigned char borrowed = false; - - if (PyArg_ParseTuple(args, "Lb", &object, &borrowed)) - { - self->object_ = reinterpret_cast<OrthancPluginPeers*>(static_cast<intptr_t>(object)); - self->borrowed_ = borrowed; - return 0; - } - else - { - PyErr_SetString(PyExc_ValueError, "Expected a pair (pointer, borrowed) in the constructor"); - return -1; - } -} - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginPeers_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.Peers", /* tp_name */ - sizeof(sdk_OrthancPluginPeers_Object), /* tp_basicsize */ -}; - - -static void sdk_OrthancPluginPeers_Destructor(PyObject *self) -{ - PythonLock::LogCall("Destroying Python object of class OrthancPluginPeers"); - - sdk_OrthancPluginPeers_Object& tmp = *((sdk_OrthancPluginPeers_Object*) self); - - if (tmp.object_ != NULL && - !tmp.borrowed_) - { - OrthancPluginFreePeers(OrthancPlugins::GetGlobalContext(), tmp.object_); - tmp.object_ = NULL; - } - - Py_TYPE(self)->tp_free((PyObject *)self); -} - - -static void RegisterOrthancPluginPeersClass(PyObject* module) -{ - sdk_OrthancPluginPeers_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginPeers_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginPeers_Type.tp_doc = "Generated from Orthanc C class: OrthancPluginPeers"; - sdk_OrthancPluginPeers_Type.tp_methods = sdk_OrthancPluginPeers_Methods; - sdk_OrthancPluginPeers_Type.tp_init = (initproc) sdk_OrthancPluginPeers_Constructor; - - /** - * "tp_dealloc is called when the reference count of the object goes - * down to zero. This is where you destroy the object and its - * members. It should then free the memory occupied by the object by - * calling tp_free." - * https://stackoverflow.com/a/24863227/881731 - **/ - sdk_OrthancPluginPeers_Type.tp_dealloc = sdk_OrthancPluginPeers_Destructor; - - if (PyType_Ready(&sdk_OrthancPluginPeers_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginPeers"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - Py_INCREF(&sdk_OrthancPluginPeers_Type); - if (PyModule_AddObject(module, "Peers", (PyObject *)&sdk_OrthancPluginPeers_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginPeers"); - Py_DECREF(&sdk_OrthancPluginPeers_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -} - - -PyTypeObject* GetOrthancPluginPeersType() -{ - return &sdk_OrthancPluginPeers_Type; -}
--- a/Sources/Autogenerated/sdk_OrthancPluginPeers.methods.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,161 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Actual implementation of the methods -static PyObject *sdk_OrthancPluginPeers_OrthancPluginGetPeersCount( - sdk_OrthancPluginPeers_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetPeersCount() on object of class OrthancPluginPeers"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - - long value; - { - PythonThreadsAllower allower; - value = OrthancPluginGetPeersCount(OrthancPlugins::GetGlobalContext(), self->object_); - } - - return PyLong_FromLong(value); -} - -static PyObject *sdk_OrthancPluginPeers_OrthancPluginGetPeerName( - sdk_OrthancPluginPeers_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetPeerName() on object of class OrthancPluginPeers"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - unsigned long arg0 = 0; - - if (!PyArg_ParseTuple(args, "k", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - const char* s; - { - PythonThreadsAllower allower; - s = OrthancPluginGetPeerName(OrthancPlugins::GetGlobalContext(), self->object_, arg0); - } - - if (s == NULL) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - return PyUnicode_FromString(s); - } -} - -static PyObject *sdk_OrthancPluginPeers_OrthancPluginGetPeerUrl( - sdk_OrthancPluginPeers_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetPeerUrl() on object of class OrthancPluginPeers"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - unsigned long arg0 = 0; - - if (!PyArg_ParseTuple(args, "k", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - const char* s; - { - PythonThreadsAllower allower; - s = OrthancPluginGetPeerUrl(OrthancPlugins::GetGlobalContext(), self->object_, arg0); - } - - if (s == NULL) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - return PyUnicode_FromString(s); - } -} - -static PyObject *sdk_OrthancPluginPeers_OrthancPluginGetPeerUserProperty( - sdk_OrthancPluginPeers_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginGetPeerUserProperty() on object of class OrthancPluginPeers"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - unsigned long arg0 = 0; - const char* arg1 = NULL; - - if (!PyArg_ParseTuple(args, "ks", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - - const char* s; - { - PythonThreadsAllower allower; - s = OrthancPluginGetPeerUserProperty(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1); - } - - if (s == NULL) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - return PyUnicode_FromString(s); - } -} -
--- a/Sources/Autogenerated/sdk_OrthancPluginPixelFormat.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginPixelFormat_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginPixelFormat_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.PixelFormat", /* tp_name */ - sizeof(sdk_OrthancPluginPixelFormat_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginPixelFormatEnumeration(PyObject* module) -{ - sdk_OrthancPluginPixelFormat_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginPixelFormat_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginPixelFormat_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginPixelFormat"; - - sdk_OrthancPluginPixelFormat_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginPixelFormat_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginPixelFormat"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "GRAYSCALE8", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2); - PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "GRAYSCALE16", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(3); - PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "SIGNED_GRAYSCALE16", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(4); - PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "RGB24", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(5); - PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "RGBA32", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(6); - PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "UNKNOWN", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(7); - PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "RGB48", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(8); - PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "GRAYSCALE32", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(9); - PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "FLOAT32", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(10); - PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "BGRA32", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(11); - PyDict_SetItemString(sdk_OrthancPluginPixelFormat_Type.tp_dict, "GRAYSCALE64", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginPixelFormat_Type); - if (PyModule_AddObject(module, "PixelFormat", (PyObject *)&sdk_OrthancPluginPixelFormat_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginPixelFormat"); - Py_DECREF(&sdk_OrthancPluginPixelFormat_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginQueueOrigin.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginQueueOrigin_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginQueueOrigin_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.QueueOrigin", /* tp_name */ - sizeof(sdk_OrthancPluginQueueOrigin_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginQueueOriginEnumeration(PyObject* module) -{ - sdk_OrthancPluginQueueOrigin_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginQueueOrigin_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginQueueOrigin_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginQueueOrigin"; - - sdk_OrthancPluginQueueOrigin_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginQueueOrigin_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginQueueOrigin"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(0); - PyDict_SetItemString(sdk_OrthancPluginQueueOrigin_Type.tp_dict, "FRONT", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginQueueOrigin_Type.tp_dict, "BACK", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginQueueOrigin_Type); - if (PyModule_AddObject(module, "QueueOrigin", (PyObject *)&sdk_OrthancPluginQueueOrigin_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginQueueOrigin"); - Py_DECREF(&sdk_OrthancPluginQueueOrigin_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginReceivedInstanceAction.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginReceivedInstanceAction_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginReceivedInstanceAction_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.ReceivedInstanceAction", /* tp_name */ - sizeof(sdk_OrthancPluginReceivedInstanceAction_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginReceivedInstanceActionEnumeration(PyObject* module) -{ - sdk_OrthancPluginReceivedInstanceAction_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginReceivedInstanceAction_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginReceivedInstanceAction_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginReceivedInstanceAction"; - - sdk_OrthancPluginReceivedInstanceAction_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginReceivedInstanceAction_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginReceivedInstanceAction"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginReceivedInstanceAction_Type.tp_dict, "KEEP_AS_IS", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2); - PyDict_SetItemString(sdk_OrthancPluginReceivedInstanceAction_Type.tp_dict, "MODIFY", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(3); - PyDict_SetItemString(sdk_OrthancPluginReceivedInstanceAction_Type.tp_dict, "DISCARD", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginReceivedInstanceAction_Type); - if (PyModule_AddObject(module, "ReceivedInstanceAction", (PyObject *)&sdk_OrthancPluginReceivedInstanceAction_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginReceivedInstanceAction"); - Py_DECREF(&sdk_OrthancPluginReceivedInstanceAction_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginResourceType.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginResourceType_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginResourceType_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.ResourceType", /* tp_name */ - sizeof(sdk_OrthancPluginResourceType_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginResourceTypeEnumeration(PyObject* module) -{ - sdk_OrthancPluginResourceType_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginResourceType_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginResourceType_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginResourceType"; - - sdk_OrthancPluginResourceType_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginResourceType_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginResourceType"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(0); - PyDict_SetItemString(sdk_OrthancPluginResourceType_Type.tp_dict, "PATIENT", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginResourceType_Type.tp_dict, "STUDY", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2); - PyDict_SetItemString(sdk_OrthancPluginResourceType_Type.tp_dict, "SERIES", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(3); - PyDict_SetItemString(sdk_OrthancPluginResourceType_Type.tp_dict, "INSTANCE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(4); - PyDict_SetItemString(sdk_OrthancPluginResourceType_Type.tp_dict, "NONE", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginResourceType_Type); - if (PyModule_AddObject(module, "ResourceType", (PyObject *)&sdk_OrthancPluginResourceType_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginResourceType"); - Py_DECREF(&sdk_OrthancPluginResourceType_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginRestOutput.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,185 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Forward declaration of the autogenerated methods -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginAnswerBuffer( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginCompressAndAnswerPngImage( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginRedirect( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendHttpStatusCode( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendUnauthorized( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendMethodNotAllowed( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSetCookie( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSetHttpHeader( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginStartMultipartAnswer( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendMultipartItem( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendHttpStatus( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginCompressAndAnswerJpegImage( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSetHttpErrorDetails( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginStartStreamAnswer( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendStreamChunk( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args); -// End of forward declarations - - -// Forward declaration of the custom methods -// End of forward declarations - - -static PyMethodDef sdk_OrthancPluginRestOutput_Methods[] = { - { "AnswerBuffer", - (PyCFunction) sdk_OrthancPluginRestOutput_OrthancPluginAnswerBuffer, METH_VARARGS, - "Generated from C function OrthancPluginAnswerBuffer()" }, - { "CompressAndAnswerPngImage", - (PyCFunction) sdk_OrthancPluginRestOutput_OrthancPluginCompressAndAnswerPngImage, METH_VARARGS, - "Generated from C function OrthancPluginCompressAndAnswerPngImage()" }, - { "Redirect", - (PyCFunction) sdk_OrthancPluginRestOutput_OrthancPluginRedirect, METH_VARARGS, - "Generated from C function OrthancPluginRedirect()" }, - { "SendHttpStatusCode", - (PyCFunction) sdk_OrthancPluginRestOutput_OrthancPluginSendHttpStatusCode, METH_VARARGS, - "Generated from C function OrthancPluginSendHttpStatusCode()" }, - { "SendUnauthorized", - (PyCFunction) sdk_OrthancPluginRestOutput_OrthancPluginSendUnauthorized, METH_VARARGS, - "Generated from C function OrthancPluginSendUnauthorized()" }, - { "SendMethodNotAllowed", - (PyCFunction) sdk_OrthancPluginRestOutput_OrthancPluginSendMethodNotAllowed, METH_VARARGS, - "Generated from C function OrthancPluginSendMethodNotAllowed()" }, - { "SetCookie", - (PyCFunction) sdk_OrthancPluginRestOutput_OrthancPluginSetCookie, METH_VARARGS, - "Generated from C function OrthancPluginSetCookie()" }, - { "SetHttpHeader", - (PyCFunction) sdk_OrthancPluginRestOutput_OrthancPluginSetHttpHeader, METH_VARARGS, - "Generated from C function OrthancPluginSetHttpHeader()" }, - { "StartMultipartAnswer", - (PyCFunction) sdk_OrthancPluginRestOutput_OrthancPluginStartMultipartAnswer, METH_VARARGS, - "Generated from C function OrthancPluginStartMultipartAnswer()" }, - { "SendMultipartItem", - (PyCFunction) sdk_OrthancPluginRestOutput_OrthancPluginSendMultipartItem, METH_VARARGS, - "Generated from C function OrthancPluginSendMultipartItem()" }, - { "SendHttpStatus", - (PyCFunction) sdk_OrthancPluginRestOutput_OrthancPluginSendHttpStatus, METH_VARARGS, - "Generated from C function OrthancPluginSendHttpStatus()" }, - { "CompressAndAnswerJpegImage", - (PyCFunction) sdk_OrthancPluginRestOutput_OrthancPluginCompressAndAnswerJpegImage, METH_VARARGS, - "Generated from C function OrthancPluginCompressAndAnswerJpegImage()" }, - { "SetHttpErrorDetails", - (PyCFunction) sdk_OrthancPluginRestOutput_OrthancPluginSetHttpErrorDetails, METH_VARARGS, - "Generated from C function OrthancPluginSetHttpErrorDetails()" }, - { "StartStreamAnswer", - (PyCFunction) sdk_OrthancPluginRestOutput_OrthancPluginStartStreamAnswer, METH_VARARGS, - "Generated from C function OrthancPluginStartStreamAnswer()" }, - { "SendStreamChunk", - (PyCFunction) sdk_OrthancPluginRestOutput_OrthancPluginSendStreamChunk, METH_VARARGS, - "Generated from C function OrthancPluginSendStreamChunk()" }, - { NULL } /* Sentinel */ -}; - - -static int sdk_OrthancPluginRestOutput_Constructor( - sdk_OrthancPluginRestOutput_Object *self, PyObject *args, PyObject *kwds) -{ - PythonLock::LogCall("Creating Python object of class OrthancPluginRestOutput"); - - self->object_ = NULL; - self->borrowed_ = false; - - long long object = 0; - unsigned char borrowed = false; - - if (PyArg_ParseTuple(args, "Lb", &object, &borrowed)) - { - self->object_ = reinterpret_cast<OrthancPluginRestOutput*>(static_cast<intptr_t>(object)); - self->borrowed_ = borrowed; - return 0; - } - else - { - PyErr_SetString(PyExc_ValueError, "Expected a pair (pointer, borrowed) in the constructor"); - return -1; - } -} - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginRestOutput_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.RestOutput", /* tp_name */ - sizeof(sdk_OrthancPluginRestOutput_Object), /* tp_basicsize */ -}; - - - - -static void RegisterOrthancPluginRestOutputClass(PyObject* module) -{ - sdk_OrthancPluginRestOutput_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginRestOutput_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginRestOutput_Type.tp_doc = "Generated from Orthanc C class: OrthancPluginRestOutput"; - sdk_OrthancPluginRestOutput_Type.tp_methods = sdk_OrthancPluginRestOutput_Methods; - sdk_OrthancPluginRestOutput_Type.tp_init = (initproc) sdk_OrthancPluginRestOutput_Constructor; - - - if (PyType_Ready(&sdk_OrthancPluginRestOutput_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginRestOutput"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - Py_INCREF(&sdk_OrthancPluginRestOutput_Type); - if (PyModule_AddObject(module, "RestOutput", (PyObject *)&sdk_OrthancPluginRestOutput_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginRestOutput"); - Py_DECREF(&sdk_OrthancPluginRestOutput_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -} - - -PyTypeObject* GetOrthancPluginRestOutputType() -{ - return &sdk_OrthancPluginRestOutput_Type; -}
--- a/Sources/Autogenerated/sdk_OrthancPluginRestOutput.methods.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,516 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Actual implementation of the methods -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginAnswerBuffer( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginAnswerBuffer() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - Py_buffer arg0; - const char* arg2 = NULL; - - if (!PyArg_ParseTuple(args, "z*s", &arg0, &arg2)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - - { - PythonThreadsAllower allower; - OrthancPluginAnswerBuffer(OrthancPlugins::GetGlobalContext(), self->object_, (arg0.len > 0 ? arg0.buf : NULL), (arg0.len > 0 ? arg0.len : 0), arg2); - } - PyBuffer_Release(&arg0); - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginCompressAndAnswerPngImage( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginCompressAndAnswerPngImage() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - long int arg0 = 0; - unsigned long arg1 = 0; - unsigned long arg2 = 0; - unsigned long arg3 = 0; - Py_buffer arg4; - - if (!PyArg_ParseTuple(args, "lkkkz*", &arg0, &arg1, &arg2, &arg3, &arg4)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (5 arguments expected)"); - return NULL; - } - - { - PythonThreadsAllower allower; - OrthancPluginCompressAndAnswerPngImage(OrthancPlugins::GetGlobalContext(), self->object_, static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2, arg3, arg4.buf); - } - PyBuffer_Release(&arg4); - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginRedirect( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginRedirect() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - { - PythonThreadsAllower allower; - OrthancPluginRedirect(OrthancPlugins::GetGlobalContext(), self->object_, arg0); - } - - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendHttpStatusCode( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginSendHttpStatusCode() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - unsigned short arg0 = 0; - - if (!PyArg_ParseTuple(args, "H", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - { - PythonThreadsAllower allower; - OrthancPluginSendHttpStatusCode(OrthancPlugins::GetGlobalContext(), self->object_, arg0); - } - - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendUnauthorized( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginSendUnauthorized() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - { - PythonThreadsAllower allower; - OrthancPluginSendUnauthorized(OrthancPlugins::GetGlobalContext(), self->object_, arg0); - } - - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendMethodNotAllowed( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginSendMethodNotAllowed() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - { - PythonThreadsAllower allower; - OrthancPluginSendMethodNotAllowed(OrthancPlugins::GetGlobalContext(), self->object_, arg0); - } - - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSetCookie( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginSetCookie() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - const char* arg0 = NULL; - const char* arg1 = NULL; - - if (!PyArg_ParseTuple(args, "ss", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - - { - PythonThreadsAllower allower; - OrthancPluginSetCookie(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1); - } - - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSetHttpHeader( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginSetHttpHeader() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - const char* arg0 = NULL; - const char* arg1 = NULL; - - if (!PyArg_ParseTuple(args, "ss", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - - { - PythonThreadsAllower allower; - OrthancPluginSetHttpHeader(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1); - } - - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginStartMultipartAnswer( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginStartMultipartAnswer() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - const char* arg0 = NULL; - const char* arg1 = NULL; - - if (!PyArg_ParseTuple(args, "ss", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginStartMultipartAnswer(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1); - } - - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendMultipartItem( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginSendMultipartItem() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - Py_buffer arg0; - - if (!PyArg_ParseTuple(args, "z*", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginSendMultipartItem(OrthancPlugins::GetGlobalContext(), self->object_, (arg0.len > 0 ? arg0.buf : NULL), (arg0.len > 0 ? arg0.len : 0)); - } - PyBuffer_Release(&arg0); - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendHttpStatus( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginSendHttpStatus() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - unsigned short arg0 = 0; - Py_buffer arg1; - - if (!PyArg_ParseTuple(args, "Hz*", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - - { - PythonThreadsAllower allower; - OrthancPluginSendHttpStatus(OrthancPlugins::GetGlobalContext(), self->object_, arg0, (arg1.len > 0 ? arg1.buf : NULL), (arg1.len > 0 ? arg1.len : 0)); - } - PyBuffer_Release(&arg1); - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginCompressAndAnswerJpegImage( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginCompressAndAnswerJpegImage() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - long int arg0 = 0; - unsigned long arg1 = 0; - unsigned long arg2 = 0; - unsigned long arg3 = 0; - Py_buffer arg4; - unsigned char arg5 = 0; - - if (!PyArg_ParseTuple(args, "lkkkz*b", &arg0, &arg1, &arg2, &arg3, &arg4, &arg5)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (6 arguments expected)"); - return NULL; - } - - { - PythonThreadsAllower allower; - OrthancPluginCompressAndAnswerJpegImage(OrthancPlugins::GetGlobalContext(), self->object_, static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2, arg3, arg4.buf, arg5); - } - PyBuffer_Release(&arg4); - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSetHttpErrorDetails( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginSetHttpErrorDetails() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - const char* arg0 = NULL; - unsigned char arg1 = 0; - - if (!PyArg_ParseTuple(args, "sb", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - - { - PythonThreadsAllower allower; - OrthancPluginSetHttpErrorDetails(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1); - } - - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginStartStreamAnswer( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginStartStreamAnswer() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - const char* arg0 = NULL; - - if (!PyArg_ParseTuple(args, "s", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginStartStreamAnswer(OrthancPlugins::GetGlobalContext(), self->object_, arg0); - } - - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject *sdk_OrthancPluginRestOutput_OrthancPluginSendStreamChunk( - sdk_OrthancPluginRestOutput_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginSendStreamChunk() on object of class OrthancPluginRestOutput"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - Py_buffer arg0; - - if (!PyArg_ParseTuple(args, "z*", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginSendStreamChunk(OrthancPlugins::GetGlobalContext(), self->object_, (arg0.len > 0 ? arg0.buf : NULL), (arg0.len > 0 ? arg0.len : 0)); - } - PyBuffer_Release(&arg0); - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} -
--- a/Sources/Autogenerated/sdk_OrthancPluginServerChunkedRequestReader.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Forward declaration of the autogenerated methods -// End of forward declarations - - -// Forward declaration of the custom methods -// End of forward declarations - - -static PyMethodDef sdk_OrthancPluginServerChunkedRequestReader_Methods[] = { - { NULL } /* Sentinel */ -}; - - -static int sdk_OrthancPluginServerChunkedRequestReader_Constructor( - sdk_OrthancPluginServerChunkedRequestReader_Object *self, PyObject *args, PyObject *kwds) -{ - PythonLock::LogCall("Creating Python object of class OrthancPluginServerChunkedRequestReader"); - - self->object_ = NULL; - self->borrowed_ = false; - - long long object = 0; - unsigned char borrowed = false; - - if (PyArg_ParseTuple(args, "Lb", &object, &borrowed)) - { - self->object_ = reinterpret_cast<OrthancPluginServerChunkedRequestReader*>(static_cast<intptr_t>(object)); - self->borrowed_ = borrowed; - return 0; - } - else - { - PyErr_SetString(PyExc_ValueError, "Expected a pair (pointer, borrowed) in the constructor"); - return -1; - } -} - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginServerChunkedRequestReader_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.ServerChunkedRequestReader", /* tp_name */ - sizeof(sdk_OrthancPluginServerChunkedRequestReader_Object), /* tp_basicsize */ -}; - - - - -static void RegisterOrthancPluginServerChunkedRequestReaderClass(PyObject* module) -{ - sdk_OrthancPluginServerChunkedRequestReader_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginServerChunkedRequestReader_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginServerChunkedRequestReader_Type.tp_doc = "Generated from Orthanc C class: OrthancPluginServerChunkedRequestReader"; - sdk_OrthancPluginServerChunkedRequestReader_Type.tp_methods = sdk_OrthancPluginServerChunkedRequestReader_Methods; - sdk_OrthancPluginServerChunkedRequestReader_Type.tp_init = (initproc) sdk_OrthancPluginServerChunkedRequestReader_Constructor; - - - if (PyType_Ready(&sdk_OrthancPluginServerChunkedRequestReader_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginServerChunkedRequestReader"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - Py_INCREF(&sdk_OrthancPluginServerChunkedRequestReader_Type); - if (PyModule_AddObject(module, "ServerChunkedRequestReader", (PyObject *)&sdk_OrthancPluginServerChunkedRequestReader_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginServerChunkedRequestReader"); - Py_DECREF(&sdk_OrthancPluginServerChunkedRequestReader_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -} - - -PyTypeObject* GetOrthancPluginServerChunkedRequestReaderType() -{ - return &sdk_OrthancPluginServerChunkedRequestReader_Type; -}
--- a/Sources/Autogenerated/sdk_OrthancPluginServerChunkedRequestReader.methods.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Actual implementation of the methods
--- a/Sources/Autogenerated/sdk_OrthancPluginStableStatus.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginStableStatus_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginStableStatus_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.StableStatus", /* tp_name */ - sizeof(sdk_OrthancPluginStableStatus_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginStableStatusEnumeration(PyObject* module) -{ - sdk_OrthancPluginStableStatus_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginStableStatus_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginStableStatus_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginStableStatus"; - - sdk_OrthancPluginStableStatus_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginStableStatus_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginStableStatus"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(0); - PyDict_SetItemString(sdk_OrthancPluginStableStatus_Type.tp_dict, "STABLE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginStableStatus_Type.tp_dict, "UNSTABLE", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginStableStatus_Type); - if (PyModule_AddObject(module, "StableStatus", (PyObject *)&sdk_OrthancPluginStableStatus_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginStableStatus"); - Py_DECREF(&sdk_OrthancPluginStableStatus_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginStorageArea.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Forward declaration of the autogenerated methods -static PyObject *sdk_OrthancPluginStorageArea_OrthancPluginStorageAreaCreate( - sdk_OrthancPluginStorageArea_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginStorageArea_OrthancPluginStorageAreaRead( - sdk_OrthancPluginStorageArea_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginStorageArea_OrthancPluginStorageAreaRemove( - sdk_OrthancPluginStorageArea_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginStorageArea_OrthancPluginReconstructMainDicomTags( - sdk_OrthancPluginStorageArea_Object* self, PyObject *args); -// End of forward declarations - - -// Forward declaration of the custom methods -// End of forward declarations - - -static PyMethodDef sdk_OrthancPluginStorageArea_Methods[] = { - { "StorageAreaCreate", - (PyCFunction) sdk_OrthancPluginStorageArea_OrthancPluginStorageAreaCreate, METH_VARARGS, - "Generated from C function OrthancPluginStorageAreaCreate()" }, - { "StorageAreaRead", - (PyCFunction) sdk_OrthancPluginStorageArea_OrthancPluginStorageAreaRead, METH_VARARGS, - "Generated from C function OrthancPluginStorageAreaRead()" }, - { "StorageAreaRemove", - (PyCFunction) sdk_OrthancPluginStorageArea_OrthancPluginStorageAreaRemove, METH_VARARGS, - "Generated from C function OrthancPluginStorageAreaRemove()" }, - { "ReconstructMainDicomTags", - (PyCFunction) sdk_OrthancPluginStorageArea_OrthancPluginReconstructMainDicomTags, METH_VARARGS, - "Generated from C function OrthancPluginReconstructMainDicomTags()" }, - { NULL } /* Sentinel */ -}; - - -static int sdk_OrthancPluginStorageArea_Constructor( - sdk_OrthancPluginStorageArea_Object *self, PyObject *args, PyObject *kwds) -{ - PythonLock::LogCall("Creating Python object of class OrthancPluginStorageArea"); - - self->object_ = NULL; - self->borrowed_ = false; - - long long object = 0; - unsigned char borrowed = false; - - if (PyArg_ParseTuple(args, "Lb", &object, &borrowed)) - { - self->object_ = reinterpret_cast<OrthancPluginStorageArea*>(static_cast<intptr_t>(object)); - self->borrowed_ = borrowed; - return 0; - } - else - { - PyErr_SetString(PyExc_ValueError, "Expected a pair (pointer, borrowed) in the constructor"); - return -1; - } -} - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginStorageArea_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.StorageArea", /* tp_name */ - sizeof(sdk_OrthancPluginStorageArea_Object), /* tp_basicsize */ -}; - - - - -static void RegisterOrthancPluginStorageAreaClass(PyObject* module) -{ - sdk_OrthancPluginStorageArea_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginStorageArea_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginStorageArea_Type.tp_doc = "Generated from Orthanc C class: OrthancPluginStorageArea"; - sdk_OrthancPluginStorageArea_Type.tp_methods = sdk_OrthancPluginStorageArea_Methods; - sdk_OrthancPluginStorageArea_Type.tp_init = (initproc) sdk_OrthancPluginStorageArea_Constructor; - - - if (PyType_Ready(&sdk_OrthancPluginStorageArea_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginStorageArea"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - Py_INCREF(&sdk_OrthancPluginStorageArea_Type); - if (PyModule_AddObject(module, "StorageArea", (PyObject *)&sdk_OrthancPluginStorageArea_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginStorageArea"); - Py_DECREF(&sdk_OrthancPluginStorageArea_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -} - - -PyTypeObject* GetOrthancPluginStorageAreaType() -{ - return &sdk_OrthancPluginStorageArea_Type; -}
--- a/Sources/Autogenerated/sdk_OrthancPluginStorageArea.methods.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,186 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Actual implementation of the methods -static PyObject *sdk_OrthancPluginStorageArea_OrthancPluginStorageAreaCreate( - sdk_OrthancPluginStorageArea_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginStorageAreaCreate() on object of class OrthancPluginStorageArea"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - const char* arg0 = NULL; - Py_buffer arg1; - unsigned long long arg2 = 0; - long int arg3 = 0; - - if (!PyArg_ParseTuple(args, "sz*Kl", &arg0, &arg1, &arg2, &arg3)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)"); - return NULL; - } - - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginStorageAreaCreate(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1.buf, arg2, static_cast<OrthancPluginContentType>(arg3)); - } - PyBuffer_Release(&arg1); - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject *sdk_OrthancPluginStorageArea_OrthancPluginStorageAreaRead( - sdk_OrthancPluginStorageArea_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginStorageAreaRead() on object of class OrthancPluginStorageArea"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - const char* arg0 = NULL; - long int arg1 = 0; - - if (!PyArg_ParseTuple(args, "sl", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - - OrthancPlugins::MemoryBuffer buffer; - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginStorageAreaRead(OrthancPlugins::GetGlobalContext(), *buffer, self->object_, arg0, static_cast<OrthancPluginContentType>(arg1)); - } - - if (code == OrthancPluginErrorCode_Success) - { - return PyBytes_FromStringAndSize(reinterpret_cast<const char*>(buffer.GetData()), buffer.GetSize()); - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject *sdk_OrthancPluginStorageArea_OrthancPluginStorageAreaRemove( - sdk_OrthancPluginStorageArea_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginStorageAreaRemove() on object of class OrthancPluginStorageArea"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - const char* arg0 = NULL; - long int arg1 = 0; - - if (!PyArg_ParseTuple(args, "sl", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginStorageAreaRemove(OrthancPlugins::GetGlobalContext(), self->object_, arg0, static_cast<OrthancPluginContentType>(arg1)); - } - - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject *sdk_OrthancPluginStorageArea_OrthancPluginReconstructMainDicomTags( - sdk_OrthancPluginStorageArea_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginReconstructMainDicomTags() on object of class OrthancPluginStorageArea"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - long int arg0 = 0; - - if (!PyArg_ParseTuple(args, "l", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginReconstructMainDicomTags(OrthancPlugins::GetGlobalContext(), self->object_, static_cast<OrthancPluginResourceType>(arg0)); - } - - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} -
--- a/Sources/Autogenerated/sdk_OrthancPluginStorageCommitmentFailureReason.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,126 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginStorageCommitmentFailureReason_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginStorageCommitmentFailureReason_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.StorageCommitmentFailureReason", /* tp_name */ - sizeof(sdk_OrthancPluginStorageCommitmentFailureReason_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginStorageCommitmentFailureReasonEnumeration(PyObject* module) -{ - sdk_OrthancPluginStorageCommitmentFailureReason_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginStorageCommitmentFailureReason_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginStorageCommitmentFailureReason_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginStorageCommitmentFailureReason"; - - sdk_OrthancPluginStorageCommitmentFailureReason_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginStorageCommitmentFailureReason_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginStorageCommitmentFailureReason"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(0); - PyDict_SetItemString(sdk_OrthancPluginStorageCommitmentFailureReason_Type.tp_dict, "SUCCESS", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginStorageCommitmentFailureReason_Type.tp_dict, "PROCESSING_FAILURE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2); - PyDict_SetItemString(sdk_OrthancPluginStorageCommitmentFailureReason_Type.tp_dict, "NO_SUCH_OBJECT_INSTANCE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(3); - PyDict_SetItemString(sdk_OrthancPluginStorageCommitmentFailureReason_Type.tp_dict, "RESOURCE_LIMITATION", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(4); - PyDict_SetItemString(sdk_OrthancPluginStorageCommitmentFailureReason_Type.tp_dict, "REFERENCED_SOPCLASS_NOT_SUPPORTED", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(5); - PyDict_SetItemString(sdk_OrthancPluginStorageCommitmentFailureReason_Type.tp_dict, "CLASS_INSTANCE_CONFLICT", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(6); - PyDict_SetItemString(sdk_OrthancPluginStorageCommitmentFailureReason_Type.tp_dict, "DUPLICATE_TRANSACTION_UID", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginStorageCommitmentFailureReason_Type); - if (PyModule_AddObject(module, "StorageCommitmentFailureReason", (PyObject *)&sdk_OrthancPluginStorageCommitmentFailureReason_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginStorageCommitmentFailureReason"); - Py_DECREF(&sdk_OrthancPluginStorageCommitmentFailureReason_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginStoreStatus.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginStoreStatus_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginStoreStatus_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.StoreStatus", /* tp_name */ - sizeof(sdk_OrthancPluginStoreStatus_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginStoreStatusEnumeration(PyObject* module) -{ - sdk_OrthancPluginStoreStatus_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginStoreStatus_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginStoreStatus_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginStoreStatus"; - - sdk_OrthancPluginStoreStatus_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginStoreStatus_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginStoreStatus"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(0); - PyDict_SetItemString(sdk_OrthancPluginStoreStatus_Type.tp_dict, "SUCCESS", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginStoreStatus_Type.tp_dict, "ALREADY_STORED", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2); - PyDict_SetItemString(sdk_OrthancPluginStoreStatus_Type.tp_dict, "FAILURE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(3); - PyDict_SetItemString(sdk_OrthancPluginStoreStatus_Type.tp_dict, "FILTERED_OUT", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(4); - PyDict_SetItemString(sdk_OrthancPluginStoreStatus_Type.tp_dict, "STORAGE_FULL", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginStoreStatus_Type); - if (PyModule_AddObject(module, "StoreStatus", (PyObject *)&sdk_OrthancPluginStoreStatus_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginStoreStatus"); - Py_DECREF(&sdk_OrthancPluginStoreStatus_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginValueRepresentation.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,246 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -typedef struct -{ - PyObject_HEAD -} sdk_OrthancPluginValueRepresentation_Object; - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginValueRepresentation_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.ValueRepresentation", /* tp_name */ - sizeof(sdk_OrthancPluginValueRepresentation_Object), /* tp_basicsize */ -}; - - -void RegisterOrthancPluginValueRepresentationEnumeration(PyObject* module) -{ - sdk_OrthancPluginValueRepresentation_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginValueRepresentation_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginValueRepresentation_Type.tp_doc = "Generated from C enumeration OrthancPluginOrthancPluginValueRepresentation"; - - sdk_OrthancPluginValueRepresentation_Type.tp_dict = PyDict_New(); - - if (PyType_Ready(&sdk_OrthancPluginValueRepresentation_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginValueRepresentation"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - /** - * Declare constants here (static members = class attributes) - * https://stackoverflow.com/a/8017906/881731 - * - * "Static and class methods can be defined in tp_methods by adding - * METH_STATIC or METH_CLASS to the ml_flags field of the - * PyMethodDef structure. This is equivalent to @staticmethod and - * @classmethod decorators." - * - * "Class attributes can be added by setting the tp_dict to a - * dictionary with these attributes before calling PyType_Ready() - * (in your module initialization function)." - **/ - - { - PyObject* tmp = PyLong_FromLong(1); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "AE", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(2); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "AS", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(3); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "AT", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(4); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "CS", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(5); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "DA", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(6); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "DS", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(7); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "DT", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(8); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "FD", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(9); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "FL", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(10); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "IS", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(11); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "LO", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(12); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "LT", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(13); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "OB", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(14); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "OF", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(15); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "OW", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(16); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "PN", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(17); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "SH", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(18); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "SL", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(19); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "SQ", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(20); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "SS", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(21); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "ST", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(22); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "TM", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(23); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "UI", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(24); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "UL", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(25); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "UN", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(26); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "US", tmp); - Py_DECREF(tmp); - } - - { - PyObject* tmp = PyLong_FromLong(27); - PyDict_SetItemString(sdk_OrthancPluginValueRepresentation_Type.tp_dict, "UT", tmp); - Py_DECREF(tmp); - } - - - Py_INCREF(&sdk_OrthancPluginValueRepresentation_Type); - if (PyModule_AddObject(module, "ValueRepresentation", (PyObject *)&sdk_OrthancPluginValueRepresentation_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python enumeration: OrthancPluginValueRepresentation"); - Py_DECREF(&sdk_OrthancPluginValueRepresentation_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -}
--- a/Sources/Autogenerated/sdk_OrthancPluginWebDavCollection.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Forward declaration of the autogenerated methods -// End of forward declarations - - -// Forward declaration of the custom methods -// End of forward declarations - - -static PyMethodDef sdk_OrthancPluginWebDavCollection_Methods[] = { - { NULL } /* Sentinel */ -}; - - -static int sdk_OrthancPluginWebDavCollection_Constructor( - sdk_OrthancPluginWebDavCollection_Object *self, PyObject *args, PyObject *kwds) -{ - PythonLock::LogCall("Creating Python object of class OrthancPluginWebDavCollection"); - - self->object_ = NULL; - self->borrowed_ = false; - - long long object = 0; - unsigned char borrowed = false; - - if (PyArg_ParseTuple(args, "Lb", &object, &borrowed)) - { - self->object_ = reinterpret_cast<OrthancPluginWebDavCollection*>(static_cast<intptr_t>(object)); - self->borrowed_ = borrowed; - return 0; - } - else - { - PyErr_SetString(PyExc_ValueError, "Expected a pair (pointer, borrowed) in the constructor"); - return -1; - } -} - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginWebDavCollection_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.WebDavCollection", /* tp_name */ - sizeof(sdk_OrthancPluginWebDavCollection_Object), /* tp_basicsize */ -}; - - - - -static void RegisterOrthancPluginWebDavCollectionClass(PyObject* module) -{ - sdk_OrthancPluginWebDavCollection_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginWebDavCollection_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginWebDavCollection_Type.tp_doc = "Generated from Orthanc C class: OrthancPluginWebDavCollection"; - sdk_OrthancPluginWebDavCollection_Type.tp_methods = sdk_OrthancPluginWebDavCollection_Methods; - sdk_OrthancPluginWebDavCollection_Type.tp_init = (initproc) sdk_OrthancPluginWebDavCollection_Constructor; - - - if (PyType_Ready(&sdk_OrthancPluginWebDavCollection_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginWebDavCollection"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - Py_INCREF(&sdk_OrthancPluginWebDavCollection_Type); - if (PyModule_AddObject(module, "WebDavCollection", (PyObject *)&sdk_OrthancPluginWebDavCollection_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginWebDavCollection"); - Py_DECREF(&sdk_OrthancPluginWebDavCollection_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -} - - -PyTypeObject* GetOrthancPluginWebDavCollectionType() -{ - return &sdk_OrthancPluginWebDavCollection_Type; -}
--- a/Sources/Autogenerated/sdk_OrthancPluginWebDavCollection.methods.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Actual implementation of the methods
--- a/Sources/Autogenerated/sdk_OrthancPluginWorklistAnswers.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,120 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Forward declaration of the autogenerated methods -static PyObject *sdk_OrthancPluginWorklistAnswers_OrthancPluginWorklistAddAnswer( - sdk_OrthancPluginWorklistAnswers_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginWorklistAnswers_OrthancPluginWorklistMarkIncomplete( - sdk_OrthancPluginWorklistAnswers_Object* self, PyObject *args); -// End of forward declarations - - -// Forward declaration of the custom methods -// End of forward declarations - - -static PyMethodDef sdk_OrthancPluginWorklistAnswers_Methods[] = { - { "WorklistAddAnswer", - (PyCFunction) sdk_OrthancPluginWorklistAnswers_OrthancPluginWorklistAddAnswer, METH_VARARGS, - "Generated from C function OrthancPluginWorklistAddAnswer()" }, - { "WorklistMarkIncomplete", - (PyCFunction) sdk_OrthancPluginWorklistAnswers_OrthancPluginWorklistMarkIncomplete, METH_VARARGS, - "Generated from C function OrthancPluginWorklistMarkIncomplete()" }, - { NULL } /* Sentinel */ -}; - - -static int sdk_OrthancPluginWorklistAnswers_Constructor( - sdk_OrthancPluginWorklistAnswers_Object *self, PyObject *args, PyObject *kwds) -{ - PythonLock::LogCall("Creating Python object of class OrthancPluginWorklistAnswers"); - - self->object_ = NULL; - self->borrowed_ = false; - - long long object = 0; - unsigned char borrowed = false; - - if (PyArg_ParseTuple(args, "Lb", &object, &borrowed)) - { - self->object_ = reinterpret_cast<OrthancPluginWorklistAnswers*>(static_cast<intptr_t>(object)); - self->borrowed_ = borrowed; - return 0; - } - else - { - PyErr_SetString(PyExc_ValueError, "Expected a pair (pointer, borrowed) in the constructor"); - return -1; - } -} - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginWorklistAnswers_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.WorklistAnswers", /* tp_name */ - sizeof(sdk_OrthancPluginWorklistAnswers_Object), /* tp_basicsize */ -}; - - - - -static void RegisterOrthancPluginWorklistAnswersClass(PyObject* module) -{ - sdk_OrthancPluginWorklistAnswers_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginWorklistAnswers_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginWorklistAnswers_Type.tp_doc = "Generated from Orthanc C class: OrthancPluginWorklistAnswers"; - sdk_OrthancPluginWorklistAnswers_Type.tp_methods = sdk_OrthancPluginWorklistAnswers_Methods; - sdk_OrthancPluginWorklistAnswers_Type.tp_init = (initproc) sdk_OrthancPluginWorklistAnswers_Constructor; - - - if (PyType_Ready(&sdk_OrthancPluginWorklistAnswers_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginWorklistAnswers"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - Py_INCREF(&sdk_OrthancPluginWorklistAnswers_Type); - if (PyModule_AddObject(module, "WorklistAnswers", (PyObject *)&sdk_OrthancPluginWorklistAnswers_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginWorklistAnswers"); - Py_DECREF(&sdk_OrthancPluginWorklistAnswers_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -} - - -PyTypeObject* GetOrthancPluginWorklistAnswersType() -{ - return &sdk_OrthancPluginWorklistAnswers_Type; -}
--- a/Sources/Autogenerated/sdk_OrthancPluginWorklistAnswers.methods.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Actual implementation of the methods -static PyObject *sdk_OrthancPluginWorklistAnswers_OrthancPluginWorklistAddAnswer( - sdk_OrthancPluginWorklistAnswers_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginWorklistAddAnswer() on object of class OrthancPluginWorklistAnswers"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - PyObject* arg0 = NULL; - Py_buffer arg1; - - if (!PyArg_ParseTuple(args, "Oz*", &arg0, &arg1)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); - return NULL; - } - - if (arg0 != Py_None && Py_TYPE(arg0) != GetOrthancPluginWorklistQueryType()) - { - PyErr_SetString(PyExc_TypeError, "Invalid orthanc.OrthancPluginWorklistQuery object"); - return NULL; - } - - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginWorklistAddAnswer(OrthancPlugins::GetGlobalContext(), self->object_, arg0 == Py_None ? NULL : reinterpret_cast<sdk_OrthancPluginWorklistQuery_Object*>(arg0)->object_, (arg1.len > 0 ? arg1.buf : NULL), (arg1.len > 0 ? arg1.len : 0)); - } - PyBuffer_Release(&arg1); - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} - -static PyObject *sdk_OrthancPluginWorklistAnswers_OrthancPluginWorklistMarkIncomplete( - sdk_OrthancPluginWorklistAnswers_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginWorklistMarkIncomplete() on object of class OrthancPluginWorklistAnswers"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginWorklistMarkIncomplete(OrthancPlugins::GetGlobalContext(), self->object_); - } - - - if (code == OrthancPluginErrorCode_Success) - { - Py_INCREF(Py_None); - return Py_None; - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} -
--- a/Sources/Autogenerated/sdk_OrthancPluginWorklistQuery.impl.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,120 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Forward declaration of the autogenerated methods -static PyObject *sdk_OrthancPluginWorklistQuery_OrthancPluginWorklistIsMatch( - sdk_OrthancPluginWorklistQuery_Object* self, PyObject *args); -static PyObject *sdk_OrthancPluginWorklistQuery_OrthancPluginWorklistGetDicomQuery( - sdk_OrthancPluginWorklistQuery_Object* self, PyObject *args); -// End of forward declarations - - -// Forward declaration of the custom methods -// End of forward declarations - - -static PyMethodDef sdk_OrthancPluginWorklistQuery_Methods[] = { - { "WorklistIsMatch", - (PyCFunction) sdk_OrthancPluginWorklistQuery_OrthancPluginWorklistIsMatch, METH_VARARGS, - "Generated from C function OrthancPluginWorklistIsMatch()" }, - { "WorklistGetDicomQuery", - (PyCFunction) sdk_OrthancPluginWorklistQuery_OrthancPluginWorklistGetDicomQuery, METH_VARARGS, - "Generated from C function OrthancPluginWorklistGetDicomQuery()" }, - { NULL } /* Sentinel */ -}; - - -static int sdk_OrthancPluginWorklistQuery_Constructor( - sdk_OrthancPluginWorklistQuery_Object *self, PyObject *args, PyObject *kwds) -{ - PythonLock::LogCall("Creating Python object of class OrthancPluginWorklistQuery"); - - self->object_ = NULL; - self->borrowed_ = false; - - long long object = 0; - unsigned char borrowed = false; - - if (PyArg_ParseTuple(args, "Lb", &object, &borrowed)) - { - self->object_ = reinterpret_cast<OrthancPluginWorklistQuery*>(static_cast<intptr_t>(object)); - self->borrowed_ = borrowed; - return 0; - } - else - { - PyErr_SetString(PyExc_ValueError, "Expected a pair (pointer, borrowed) in the constructor"); - return -1; - } -} - - -/** - * Static global structure => the fields that are beyond the last - * initialized field are set to zero. - * https://stackoverflow.com/a/11152199/881731 - **/ -static PyTypeObject sdk_OrthancPluginWorklistQuery_Type = { - PyVarObject_HEAD_INIT(NULL, 0) - "orthanc.WorklistQuery", /* tp_name */ - sizeof(sdk_OrthancPluginWorklistQuery_Object), /* tp_basicsize */ -}; - - - - -static void RegisterOrthancPluginWorklistQueryClass(PyObject* module) -{ - sdk_OrthancPluginWorklistQuery_Type.tp_new = PyType_GenericNew; - sdk_OrthancPluginWorklistQuery_Type.tp_flags = Py_TPFLAGS_DEFAULT; - sdk_OrthancPluginWorklistQuery_Type.tp_doc = "Generated from Orthanc C class: OrthancPluginWorklistQuery"; - sdk_OrthancPluginWorklistQuery_Type.tp_methods = sdk_OrthancPluginWorklistQuery_Methods; - sdk_OrthancPluginWorklistQuery_Type.tp_init = (initproc) sdk_OrthancPluginWorklistQuery_Constructor; - - - if (PyType_Ready(&sdk_OrthancPluginWorklistQuery_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginWorklistQuery"); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } - - Py_INCREF(&sdk_OrthancPluginWorklistQuery_Type); - if (PyModule_AddObject(module, "WorklistQuery", (PyObject *)&sdk_OrthancPluginWorklistQuery_Type) < 0) - { - ORTHANC_PLUGINS_LOG_ERROR("Cannot register Python class: OrthancPluginWorklistQuery"); - Py_DECREF(&sdk_OrthancPluginWorklistQuery_Type); - ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); - } -} - - -PyTypeObject* GetOrthancPluginWorklistQueryType() -{ - return &sdk_OrthancPluginWorklistQuery_Type; -}
--- a/Sources/Autogenerated/sdk_OrthancPluginWorklistQuery.methods.h Tue Aug 12 09:31:45 2025 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2020-2023 Osimis S.A., 2024-2025 Orthanc Team SRL, 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * Python plugin for Orthanc - * Copyright (C) 2020-2023 Osimis S.A., Belgium - * Copyright (C) 2024-2025 Orthanc Team SRL, Belgium - * Copyright (C) 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -// WARNING: Auto-generated file. Do not modify it by hand. - - -// Actual implementation of the methods -static PyObject *sdk_OrthancPluginWorklistQuery_OrthancPluginWorklistIsMatch( - sdk_OrthancPluginWorklistQuery_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginWorklistIsMatch() on object of class OrthancPluginWorklistQuery"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - Py_buffer arg0; - - if (!PyArg_ParseTuple(args, "z*", &arg0)) - { - PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); - return NULL; - } - - long value; - { - PythonThreadsAllower allower; - value = OrthancPluginWorklistIsMatch(OrthancPlugins::GetGlobalContext(), self->object_, (arg0.len > 0 ? arg0.buf : NULL), (arg0.len > 0 ? arg0.len : 0)); - } - PyBuffer_Release(&arg0); - return PyLong_FromLong(value); -} - -static PyObject *sdk_OrthancPluginWorklistQuery_OrthancPluginWorklistGetDicomQuery( - sdk_OrthancPluginWorklistQuery_Object* self, PyObject *args) -{ - PythonLock::LogCall("Calling method OrthancPluginWorklistGetDicomQuery() on object of class OrthancPluginWorklistQuery"); - - if (self->object_ == NULL) - { - PyErr_SetString(PyExc_ValueError, "Invalid object"); - return NULL; - } - - - - OrthancPlugins::MemoryBuffer buffer; - OrthancPluginErrorCode code; - { - PythonThreadsAllower allower; - code = OrthancPluginWorklistGetDicomQuery(OrthancPlugins::GetGlobalContext(), *buffer, self->object_); - } - - if (code == OrthancPluginErrorCode_Success) - { - return PyBytes_FromStringAndSize(reinterpret_cast<const char*>(buffer.GetData()), buffer.GetSize()); - } - else - { - PythonLock::RaiseException(code); - return NULL; - } -} -
--- a/Sources/DicomScpCallbacks.cpp Tue Aug 12 09:31:45 2025 +0200 +++ b/Sources/DicomScpCallbacks.cpp Tue Aug 12 10:49:50 2025 +0200 @@ -29,10 +29,11 @@ #include "PythonHeaderWrapper.h" #include "../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h" -#include "Autogenerated/sdk.h" #include "ICallbackRegistration.h" #include "PythonString.h" +#include <sdk.h> + static PyObject* findScpCallback_ = NULL; static PyObject* moveScpCallback_ = NULL;
--- a/Sources/IncomingHttpRequestFilter.cpp Tue Aug 12 09:31:45 2025 +0200 +++ b/Sources/IncomingHttpRequestFilter.cpp Tue Aug 12 10:49:50 2025 +0200 @@ -29,10 +29,10 @@ #include "PythonHeaderWrapper.h" #include "../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h" -#include "Autogenerated/sdk.h" #include "ICallbackRegistration.h" #include "PythonString.h" +#include <sdk.h> static PyObject* incomingHttpRequestFilter_ = NULL;
--- a/Sources/IncomingInstanceFilter.cpp Tue Aug 12 09:31:45 2025 +0200 +++ b/Sources/IncomingInstanceFilter.cpp Tue Aug 12 10:49:50 2025 +0200 @@ -29,10 +29,11 @@ #include "PythonHeaderWrapper.h" #include "../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h" -#include "Autogenerated/sdk.h" #include "ICallbackRegistration.h" #include "PythonString.h" +#include <sdk.h> + #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 10, 0)
--- a/Sources/OnStoredInstanceCallback.cpp Tue Aug 12 09:31:45 2025 +0200 +++ b/Sources/OnStoredInstanceCallback.cpp Tue Aug 12 10:49:50 2025 +0200 @@ -29,10 +29,11 @@ #include "PythonHeaderWrapper.h" #include "../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h" -#include "Autogenerated/sdk.h" #include "ICallbackRegistration.h" #include "PythonString.h" +#include <sdk.h> + static PyObject* storedInstanceCallback_ = NULL;
--- a/Sources/Plugin.cpp Tue Aug 12 09:31:45 2025 +0200 +++ b/Sources/Plugin.cpp Tue Aug 12 10:49:50 2025 +0200 @@ -44,9 +44,9 @@ #include "PythonThreadsAllower.h" #include "RestCallbacks.h" -#include "Autogenerated/sdk.h" +#include "../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h" -#include "../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h" +#include <sdk.h> #include <boost/algorithm/string/predicate.hpp> #include <boost/filesystem.hpp>
--- a/Sources/RestCallbacks.cpp Tue Aug 12 09:31:45 2025 +0200 +++ b/Sources/RestCallbacks.cpp Tue Aug 12 10:49:50 2025 +0200 @@ -29,10 +29,11 @@ #include "PythonHeaderWrapper.h" #include "../Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h" -#include "Autogenerated/sdk.h" #include "PythonBytes.h" #include "PythonString.h" +#include <sdk.h> + #include <boost/regex.hpp> #include <boost/thread.hpp>