# HG changeset patch # User Sebastien Jodogne # Date 1737552851 -3600 # Node ID 8076e6c483aa477c10153158f16fa7fa63ba924e # Parent 435e693d879438e731dd9f10ed8a88f97ed3e53e wrapping SDK 1.12.6 diff -r 435e693d8794 -r 8076e6c483aa Resources/Orthanc/Sdk-1.12.6/ClassDocumentation.json --- a/Resources/Orthanc/Sdk-1.12.6/ClassDocumentation.json Wed Jan 22 14:32:46 2025 +0100 +++ b/Resources/Orthanc/Sdk-1.12.6/ClassDocumentation.json Wed Jan 22 14:34:11 2025 +0100 @@ -10,7 +10,7 @@ "OrthancPluginRestOutput" : "Output for a call to the REST API of Orthanc", "OrthancPluginServerChunkedRequestReader" : "Read for a chunked HTTP request", "OrthancPluginStorageArea" : "Storage area plugin", + "OrthancPluginWebDavCollection" : "WebDAV collection", "OrthancPluginWorklistAnswers" : "Answers to a DICOM C-FIND worklist query", - "OrthancPluginWorklistQuery" : "DICOM C-FIND worklist query", - "OrthancPluginWebDavCollection" : "WebDAV collection" + "OrthancPluginWorklistQuery" : "DICOM C-FIND worklist query" } diff -r 435e693d8794 -r 8076e6c483aa Resources/Orthanc/Sdk-1.12.6/ClassDocumentation.json.license --- a/Resources/Orthanc/Sdk-1.12.6/ClassDocumentation.json.license Wed Jan 22 14:32:46 2025 +0100 +++ b/Resources/Orthanc/Sdk-1.12.6/ClassDocumentation.json.license Wed Jan 22 14:34:11 2025 +0100 @@ -1,2 +1,2 @@ -# SPDX-FileCopyrightText: 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium +# SPDX-FileCopyrightText: 2023-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium # SPDX-License-Identifier: GPL-3.0-or-later diff -r 435e693d8794 -r 8076e6c483aa Resources/Orthanc/Sdk-1.12.6/CodeModel.json --- a/Resources/Orthanc/Sdk-1.12.6/CodeModel.json Wed Jan 22 14:32:46 2025 +0100 +++ b/Resources/Orthanc/Sdk-1.12.6/CodeModel.json Wed Jan 22 14:34:11 2025 +0100 @@ -1085,10 +1085,10 @@ "answerSize": "Number of bytes of the item." }, "description": [ - "This function sends a chunk as part of some HTTP stream answer that was initiated by OrthancPluginStartStreamAnswer()." + "This function sends a chunk as part of an HTTP stream answer that was initiated by OrthancPluginStartStreamAnswer()." ], "return": "0 if success, or the error code if failure (this notably happens if the connection is closed by the client).", - "summary": "Send a chunk as a part of some HTTP stream answer." + "summary": "Send a chunk as a part of an HTTP stream answer." }, "return_sdk_enumeration": "OrthancPluginErrorCode", "return_sdk_type": "enumeration" @@ -2185,6 +2185,11 @@ "value": 2044 }, { + "documentation": "DicomUserConnection: The C-GET command is not supported by the remote SCP", + "key": "DicomGetUnavailable", + "value": 2045 + }, + { "documentation": "Unsupported media type", "key": "UnsupportedMediaType", "value": 3000 diff -r 435e693d8794 -r 8076e6c483aa Resources/Orthanc/Sdk-1.12.6/CodeModel.json.license --- a/Resources/Orthanc/Sdk-1.12.6/CodeModel.json.license Wed Jan 22 14:32:46 2025 +0100 +++ b/Resources/Orthanc/Sdk-1.12.6/CodeModel.json.license Wed Jan 22 14:34:11 2025 +0100 @@ -1,2 +1,2 @@ -# SPDX-FileCopyrightText: 2021-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium +# SPDX-FileCopyrightText: 2023-2025 Sebastien Jodogne, ICTEAM UCLouvain, Belgium # SPDX-License-Identifier: GPL-3.0-or-later diff -r 435e693d8794 -r 8076e6c483aa Resources/Orthanc/Sdk-1.12.6/orthanc/OrthancCPlugin.h --- a/Resources/Orthanc/Sdk-1.12.6/orthanc/OrthancCPlugin.h Wed Jan 22 14:32:46 2025 +0100 +++ b/Resources/Orthanc/Sdk-1.12.6/orthanc/OrthancCPlugin.h Wed Jan 22 14:34:11 2025 +0100 @@ -121,7 +121,7 @@ #define ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER 1 #define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER 12 -#define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 5 +#define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 6 #if !defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE) @@ -324,6 +324,7 @@ OrthancPluginErrorCode_AlreadyExistingTag = 2042 /*!< Cannot override the value of a tag that already exists */, OrthancPluginErrorCode_NoStorageCommitmentHandler = 2043 /*!< No request handler factory for DICOM N-ACTION SCP (storage commitment) */, OrthancPluginErrorCode_NoCGetHandler = 2044 /*!< No request handler factory for DICOM C-GET SCP */, + OrthancPluginErrorCode_DicomGetUnavailable = 2045 /*!< DicomUserConnection: The C-GET command is not supported by the remote SCP */, OrthancPluginErrorCode_UnsupportedMediaType = 3000 /*!< Unsupported media type */, _OrthancPluginErrorCode_INTERNAL = 0x7fffffff @@ -9601,9 +9602,9 @@ /** - * @brief Send a chunk as a part of some HTTP stream answer. - * - * This function sends a chunk as part of some HTTP stream + * @brief Send a chunk as a part of an HTTP stream answer. + * + * This function sends a chunk as part of an HTTP stream * answer that was initiated by OrthancPluginStartStreamAnswer(). * * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). diff -r 435e693d8794 -r 8076e6c483aa Sources/Autogenerated/orthanc.pyi --- a/Sources/Autogenerated/orthanc.pyi Wed Jan 22 14:32:46 2025 +0100 +++ b/Sources/Autogenerated/orthanc.pyi Wed Jan 22 14:34:11 2025 +0100 @@ -31,7 +31,7 @@ class ChangeType(): """ - The supported types of changes that can be signaled to the change callback. + The supported types of changes that can be signaled to the change callback. Note: this enum is not used to store changes in the DB ! """ """ @@ -211,7 +211,7 @@ class CreateDicomFlags(): """ - Flags to the creation of a DICOM file. + Flags for the creation of a DICOM file. """ """ @@ -550,6 +550,26 @@ 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, @@ -605,7 +625,7 @@ SQLITE_CANNOT_STEP: int = 1010, """ - SQLite: Bing a value while out of range (serious error) + SQLite: Bind a value while out of range (serious error) """ SQLITE_BIND_OUT_OF_RANGE: int = 1011, @@ -855,6 +875,11 @@ 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, @@ -1009,6 +1034,91 @@ """ 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. @@ -1560,6 +1670,17 @@ """ ... +# 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: """ @@ -1625,6 +1746,14 @@ """ ... +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: """ @@ -1815,6 +1944,20 @@ """ ... +# 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: """ @@ -1835,6 +1978,21 @@ """ ... +# 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: """ @@ -2076,6 +2234,16 @@ """ ... +# 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: """ @@ -2086,6 +2254,17 @@ """ ... +# 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: """ @@ -2097,10 +2276,10 @@ """ ... -# This function sets the value of a metrics to monitor the behavior of the plugin through tools such as Prometheus +# 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 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. + 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. @@ -2119,6 +2298,17 @@ """ ... +# 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: """ @@ -3001,6 +3191,26 @@ 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: """ @@ -3064,6 +3274,13 @@ """ ... +class WebDavCollection: + """ + WebDAV collection + """ + ... + + class WorklistAnswers: """ Answers to a DICOM C-FIND worklist query diff -r 435e693d8794 -r 8076e6c483aa Sources/Autogenerated/sdk.cpp --- a/Sources/Autogenerated/sdk.cpp Wed Jan 22 14:32:46 2025 +0100 +++ b/Sources/Autogenerated/sdk.cpp Wed Jan 22 14:34:11 2025 +0100 @@ -49,6 +49,9 @@ #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" @@ -67,6 +70,7 @@ #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" @@ -83,6 +87,7 @@ #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" @@ -103,6 +108,9 @@ RegisterOrthancPluginInstanceOriginEnumeration(module); RegisterOrthancPluginJobStepStatusEnumeration(module); RegisterOrthancPluginJobStopReasonEnumeration(module); + RegisterOrthancPluginLoadDicomInstanceModeEnumeration(module); + RegisterOrthancPluginLogCategoryEnumeration(module); + RegisterOrthancPluginLogLevelEnumeration(module); RegisterOrthancPluginMetricsTypeEnumeration(module); RegisterOrthancPluginPixelFormatEnumeration(module); RegisterOrthancPluginReceivedInstanceActionEnumeration(module); @@ -121,6 +129,7 @@ RegisterOrthancPluginRestOutputClass(module); RegisterOrthancPluginServerChunkedRequestReaderClass(module); RegisterOrthancPluginStorageAreaClass(module); + RegisterOrthancPluginWebDavCollectionClass(module); RegisterOrthancPluginWorklistAnswersClass(module); RegisterOrthancPluginWorklistQueryClass(module); } diff -r 435e693d8794 -r 8076e6c483aa Sources/Autogenerated/sdk.h --- a/Sources/Autogenerated/sdk.h Wed Jan 22 14:32:46 2025 +0100 +++ b/Sources/Autogenerated/sdk.h Wed Jan 22 14:34:11 2025 +0100 @@ -45,6 +45,7 @@ PyTypeObject* GetOrthancPluginRestOutputType(); PyTypeObject* GetOrthancPluginServerChunkedRequestReaderType(); PyTypeObject* GetOrthancPluginStorageAreaType(); +PyTypeObject* GetOrthancPluginWebDavCollectionType(); PyTypeObject* GetOrthancPluginWorklistAnswersType(); PyTypeObject* GetOrthancPluginWorklistQueryType(); @@ -154,6 +155,15 @@ 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; diff -r 435e693d8794 -r 8076e6c483aa Sources/Autogenerated/sdk_GlobalFunctions.impl.h --- a/Sources/Autogenerated/sdk_GlobalFunctions.impl.h Wed Jan 22 14:32:46 2025 +0100 +++ b/Sources/Autogenerated/sdk_GlobalFunctions.impl.h Wed Jan 22 14:34:11 2025 +0100 @@ -569,6 +569,29 @@ 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()"); @@ -705,6 +728,29 @@ } } +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()"); @@ -1109,6 +1155,40 @@ } } +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(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()"); @@ -1153,6 +1233,33 @@ 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(arg4), static_cast(arg5)); + } + + + Py_INCREF(Py_None); + return Py_None; +} + static PyObject* sdk_OrthancPluginLogWarning(PyObject* module, PyObject* args) { PythonLock::LogCall("Calling Python global function: OrthancPluginLogWarning()"); @@ -1702,6 +1809,37 @@ } } +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()"); @@ -1724,6 +1862,29 @@ 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()"); @@ -1802,6 +1963,29 @@ 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()"); @@ -1939,6 +2123,8 @@ "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, @@ -1951,6 +2137,8 @@ "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, @@ -1981,10 +2169,14 @@ "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, @@ -2021,14 +2213,20 @@ "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, diff -r 435e693d8794 -r 8076e6c483aa Sources/Autogenerated/sdk_OrthancPluginErrorCode.impl.h --- a/Sources/Autogenerated/sdk_OrthancPluginErrorCode.impl.h Wed Jan 22 14:32:46 2025 +0100 +++ b/Sources/Autogenerated/sdk_OrthancPluginErrorCode.impl.h Wed Jan 22 14:34:11 2025 +0100 @@ -344,6 +344,30 @@ } { + 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); @@ -710,6 +734,12 @@ } { + 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); diff -r 435e693d8794 -r 8076e6c483aa Sources/Autogenerated/sdk_OrthancPluginRestOutput.impl.h --- a/Sources/Autogenerated/sdk_OrthancPluginRestOutput.impl.h Wed Jan 22 14:32:46 2025 +0100 +++ b/Sources/Autogenerated/sdk_OrthancPluginRestOutput.impl.h Wed Jan 22 14:34:11 2025 +0100 @@ -54,6 +54,10 @@ 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 @@ -101,6 +105,12 @@ { "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 */ }; diff -r 435e693d8794 -r 8076e6c483aa Sources/Autogenerated/sdk_OrthancPluginRestOutput.methods.h --- a/Sources/Autogenerated/sdk_OrthancPluginRestOutput.methods.h Wed Jan 22 14:32:46 2025 +0100 +++ b/Sources/Autogenerated/sdk_OrthancPluginRestOutput.methods.h Wed Jan 22 14:34:11 2025 +0100 @@ -438,3 +438,79 @@ 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, "s*", &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.buf, arg0.len); + } + PyBuffer_Release(&arg0); + + if (code == OrthancPluginErrorCode_Success) + { + Py_INCREF(Py_None); + return Py_None; + } + else + { + PythonLock::RaiseException(code); + return NULL; + } +} +