Mercurial > hg > orthanc-book
comparison Sphinx/source/plugins/python.rst @ 1075:d2be251975d1 Orthanc-1.12.4
Orthanc 1.12.4
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 05 Jun 2024 20:18:43 +0200 |
parents | c80cc6eaad99 |
children | 9fdd3714efc1 |
comparison
equal
deleted
inserted
replaced
1074:32ac45058512 | 1075:d2be251975d1 |
---|---|
16 instead of the more complex C/C++ programming languages. | 16 instead of the more complex C/C++ programming languages. |
17 | 17 |
18 Python plugins have access to more features and a more consistent SDK | 18 Python plugins have access to more features and a more consistent SDK |
19 than :ref:`Lua scripts <lua>`. The largest part of the Python API is | 19 than :ref:`Lua scripts <lua>`. The largest part of the Python API is |
20 automatically generated from the `Orthanc plugin SDK in C | 20 automatically generated from the `Orthanc plugin SDK in C |
21 <https://orthanc.uclouvain.be/hg/orthanc/file/Orthanc-1.12.3/OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h>`__ | 21 <https://orthanc.uclouvain.be/hg/orthanc/file/Orthanc-1.12.4/OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h>`__ |
22 using the `Clang <https://en.wikipedia.org/wiki/Clang>`__ compiler | 22 using the `Clang <https://en.wikipedia.org/wiki/Clang>`__ compiler |
23 front-end. | 23 front-end. |
24 | 24 |
25 As of release 3.2 of the plugin, the coverage of the C SDK is about | 25 As of release 3.2 of the plugin, the coverage of the C SDK is about |
26 87% (138 functions are automatically wrapped in Python out of a total | 26 87% (138 functions are automatically wrapped in Python out of a total |
299 When calling the REST API from a python plugin, you may use e.g. | 299 When calling the REST API from a python plugin, you may use e.g. |
300 ``RestApiPost`` to call the native Orthanc REST API and must | 300 ``RestApiPost`` to call the native Orthanc REST API and must |
301 call ``RestApiPostAfterPlugin`` to call the REST API from plugins. | 301 call ``RestApiPostAfterPlugin`` to call the REST API from plugins. |
302 | 302 |
303 | 303 |
304 Note however, that, as of Orthanc 1.12.3, the Orthanc plugin SDK | 304 Note however, that, as of Orthanc 1.12.4, the Orthanc plugin SDK |
305 does not support multiple plugins implementing the same route. | 305 does not support multiple plugins implementing the same route. |
306 Orthanc will actually accept e.g a Python plugin that overrides | 306 Orthanc will actually accept e.g a Python plugin that overrides |
307 a DICOMWeb route but it is impossible to tell which route | 307 a DICOMWeb route but it is impossible to tell which route |
308 will be called in the end since this depends on the registration | 308 will be called in the end since this depends on the registration |
309 order of the plugins that is not deterministic. | 309 order of the plugins that is not deterministic. |
888 | 888 |
889 As can be seen in this sample: | 889 As can be seen in this sample: |
890 | 890 |
891 * The call to ``orthanc.ExtendOrthancExplorer()`` installs the button | 891 * The call to ``orthanc.ExtendOrthancExplorer()`` installs the button |
892 with JavaScript code that uses the `jQuery Mobile framework | 892 with JavaScript code that uses the `jQuery Mobile framework |
893 <https://demos.jquerymobile.com/1.1.0/>`__ (as of Orthanc 1.12.3, | 893 <https://demos.jquerymobile.com/1.1.0/>`__ (as of Orthanc 1.12.4, |
894 version 1.1.0 of jQuery Mobile is used in Orthanc Explorer). | 894 version 1.1.0 of jQuery Mobile is used in Orthanc Explorer). |
895 | 895 |
896 * If clicking on the button, a GET call to the REST API is made to | 896 * If clicking on the button, a GET call to the REST API is made to |
897 ``../execute-python``. The prefix ``../`` stems from the fact that | 897 ``../execute-python``. The prefix ``../`` stems from the fact that |
898 Orthanc Explorer is branched inside the ``app/`` folder of the REST | 898 Orthanc Explorer is branched inside the ``app/`` folder of the REST |