# HG changeset patch # User Alain Mazy # Date 1721808774 -7200 # Node ID 5b6f8a2b012a412376078b4e01fd20763847f28d # Parent 7c43797528b4c0dd2b108a19d43409a3dfa38ab4# Parent ad86e352fce187fb692587a24b728eaa0f1a6f73 merge diff -r 7c43797528b4 -r 5b6f8a2b012a Sphinx/source/plugins/java.rst --- a/Sphinx/source/plugins/java.rst Wed Jul 24 10:12:19 2024 +0200 +++ b/Sphinx/source/plugins/java.rst Wed Jul 24 10:12:54 2024 +0200 @@ -22,9 +22,9 @@ using the `Clang `__ compiler front-end. -As of release 1.0 of the plugin, the coverage of the C SDK is about -76% (122 functions are automatically wrapped in Java out of a total of -160 functions from the Orthanc SDK 1.10.0). +As of release 1.0 of the plugin, **the coverage of the C SDK is about +74%** (122 functions are automatically wrapped in Java out of a total +of 165 functions from the Orthanc SDK 1.10.0). **For researchers**: `Please cite this paper `__. diff -r 7c43797528b4 -r 5b6f8a2b012a Sphinx/source/plugins/orthanc-explorer-2.rst --- a/Sphinx/source/plugins/orthanc-explorer-2.rst Wed Jul 24 10:12:19 2024 +0200 +++ b/Sphinx/source/plugins/orthanc-explorer-2.rst Wed Jul 24 10:12:54 2024 +0200 @@ -34,10 +34,13 @@ Binaries are included in: -- The `orthancteam/orthanc Docker image `__ -- The `Windows Installer `__ -- The `macOS packages `__ +- The :ref:`orthancteam/orthanc Docker image `, +- The :ref:`jodogne/orthanc-plugins Docker image `, +- The `Windows installers `__, +- The `macOS packages `__. +Precompiled binaries of the plugin alone are also available for multiple platforms on the `official download site `__. + Release notes are available `here `__. Depending on the configuration, the plugin can replace the default Orthanc UI you are redirected to when accessing orthanc at `http://localhost:8042/ `__. diff -r 7c43797528b4 -r 5b6f8a2b012a Sphinx/source/plugins/python.rst --- a/Sphinx/source/plugins/python.rst Wed Jul 24 10:12:19 2024 +0200 +++ b/Sphinx/source/plugins/python.rst Wed Jul 24 10:12:54 2024 +0200 @@ -22,9 +22,11 @@ using the `Clang `__ compiler front-end. -As of release 3.2 of the plugin, the coverage of the C SDK is about -87% (138 functions are automatically wrapped in Python out of a total -of 158 functions from the Orthanc SDK 1.8.1). +As of release 4.3 of the plugin, **the coverage of the C SDK is about +85%** (140 functions are automatically wrapped in Python out of a +total of 165 functions from the Orthanc SDK 1.10.0). Starting with +release 4.3, the code model that is used to generate the Python +wrapper is shared with the :ref:`Java wrapper `. Source code @@ -36,6 +38,11 @@ * Link to the `code repository `__. +* Link to the `Python interface + `__ + (cf. :ref:`below ` for more information + about the ``orthanc.pyi`` file). + Licensing --------- @@ -241,7 +248,8 @@ "Python" : { "Path" : "my-plugin.py", // Alias for the global "PythonScript" option "Verbose" : false, // Alias for the global "PythonVerbose" option - "DisplayMemoryUsage" : false + "DisplayMemoryUsage" : false, + "AllowThreads" : false } } @@ -249,12 +257,42 @@ of the plugin. If set to ``true``, Orthanc will display the memory usage of the Python interpreter every second. +The option ``Python.AllowThreads`` was introduced in release 4.3 of +the plugin. If set to ``true``, the Python GIL (`Global Interpreter +Lock `__) is +released during the calls to the native SDK. **This allows multiple +Python threads to simultaneously access the Orthanc core.** +Internally, this corresponds to the ``Py_BEGIN_ALLOW_THREADS`` +`construction of Python +`__. However, +this could possibly introduce concurrency issues: Make sure that your +Python code is **thread-safe** before enabling this option! Indeed, +different threads must not modify the Python objects that are used +during a call to the SDK of Orthanc. + .. warning:: Never call your Python plugin ``orthanc.py``! Otherwise, your plugin will conflict with the ``orthanc`` module that is installed at runtime. +.. _python-code-completion: + +Documentation and code completion +--------------------------------- + +Starting with release 4.3 of the Python plugin for Orthanc, a `Python +interface (cf. PEP 484 - Type Hints) +`__ is available. By downloading +the file ``orthanc.pyi`` `from this location +`__ +and putting it in the same folder as your Python script, your IDE will +provide you code completion, as well as full documentation of the +Orthanc SDK in the Python language. This file is notably known to work +with Visual Studio Code and PyCharm. + + + Samples ------- diff -r 7c43797528b4 -r 5b6f8a2b012a Sphinx/source/plugins/python/incoming-cstore-filter.py --- a/Sphinx/source/plugins/python/incoming-cstore-filter.py Wed Jul 24 10:12:19 2024 +0200 +++ b/Sphinx/source/plugins/python/incoming-cstore-filter.py Wed Jul 24 10:12:54 2024 +0200 @@ -1,13 +1,11 @@ -import json import orthanc - # this script accepts 3 instances from STORESCU and then, rejects the next ones storeScuInstanceCounter = 0 def FilterIncomingCStoreInstance(receivedDicom): - # The list ofvalid status codes for DIMSE C-STORE can be found: + # The list of valid status codes for DIMSE C-STORE can be found: # https://dicom.nema.org/medical/Dicom/2021e/output/chtml/part04/sect_B.2.3.html global storeScuInstanceCounter