comparison Sphinx/source/plugins/python.rst @ 1046:63edb430f259

mosaic
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 26 Mar 2024 09:50:04 +0100
parents fe9c92d81082
children c80cc6eaad99
comparison
equal deleted inserted replaced
1045:bb92aeb7dbde 1046:63edb430f259
394 you should use the ``RestApiPostAfterPlugins()`` method: 394 you should use the ``RestApiPostAfterPlugins()`` method:
395 395
396 .. literalinclude:: python/autorouting-2.py 396 .. literalinclude:: python/autorouting-2.py
397 :language: python 397 :language: python
398 398
399
400 .. _python-pil-thumbnail:
399 401
400 Rendering a thumbnail using PIL/Pillow 402 Rendering a thumbnail using PIL/Pillow
401 ...................................... 403 ......................................
402 404
403 .. literalinclude:: python/pil.py 405 .. literalinclude:: python/pil.py
897 Note that it is only possible to extend Orthanc Explorer 1, which is 899 Note that it is only possible to extend Orthanc Explorer 1, which is
898 the built-in Web interface of Orthanc. It is not possible to extend 900 the built-in Web interface of Orthanc. It is not possible to extend
899 the :ref:`Orthanc Explorer 2 <orthanc-explorer-2>` interface. 901 the :ref:`Orthanc Explorer 2 <orthanc-explorer-2>` interface.
900 902
901 903
904 .. _python_mosaic:
905
906 Generating a mosaic for a DICOM series
907 ......................................
908
909 Thanks to the fact that Python plugins have access to :ref:`PIL/Pillow
910 <python-pil-thumbnail>`, it is quite easy to generate a mosaic from a
911 DICOM series:
912
913 .. image:: python/mosaic.png
914 :align: center
915 :width: 512
916
917 Here is the source code:
918
919 .. literalinclude:: python/mosaic.py
920 :language: python
921
922
902 Performance and concurrency 923 Performance and concurrency
903 --------------------------- 924 ---------------------------
904 925
905 **Important:** This section only applies to UNIX-like systems. The 926 **Important:** This section only applies to UNIX-like systems. The
906 ``multiprocessing`` package will not work on Microsoft Windows as the 927 ``multiprocessing`` package will not work on Microsoft Windows as the