Question on OrthancPython

Hey Sebastien,

I’m currently looking into the packaging of OrthancPython.

The setup looks for a package ‘python-3.6-embed’. There is no such *embed package in openSUSE. What is this? C++ bindings for python?
(I found python-pybind11 for this)

Thanks
Axel

Hi Axel,

I think that it should be sufficient to install the “python3-devel” package (I found version 3.6 on Leap 15.2, but multiple versions are available in Tumbleweed), and to set the “-DPYTHON_VERSION=3.6” argument while invoking CMake.

HTH,
Sébastien-

Hi Sebastien,

I am a Ph.D. Student and working on medical imaging analysis using deep learning( artificial intelligence algorithms)
I use Python 3.6. Please help me to install Orthanc in Python and load Dicom images. Sebastien, please connect me to someone who loads Orthance in Python.

I do appreciate it if you can share any code with me.

Have a nice day.
Best,
Madi

Hello,

Please read the Orthanc Book, it explains how to run Python scripts from within Orthanc:
https://book.orthanc-server.com/plugins/python.html

You cannot do a thing such as “installing/loading Orthanc in Python”. Either you run Python from Orthanc (cf. the link above), or you call the REST API of Orthanc from Python (using e.g. the “requests” Python module):
https://book.orthanc-server.com/users/rest.html

Sébastien-

Hi Sebastien,

Hi Axel,

I managed to compile the plugin on Leap 15.2 without problem by installing the “python3-devel” package (not “python-devel”).

You’ll find my Dockerfile attached to this message.

HTH,
Sébastien-

Dockerfile.txt (1.19 KB)

Hi Sebastien,

Hi,

thanks for the reply…I got it working in between: https://build.opensuse.org/package/show/home:DocB:Orthanc/orthanc-python and it is fully Python3. It turned out that the variable I passed to DPYTHON_VERSION was hooked on an old version…but his is now fixed and it builds already for the coming Leap 15.3 :slight_smile:

Great!

Why did you use python2-pyOpenSSL instead of the python3 version in the docker build?

The “python2-pyOpenSSL” is only present to allow Mercurial to fetch data from HTTPS in my Dockerfile :wink:

Sébastien-