How to use orthanc.Job in Python plugin

Hi Orthanc users,

I’m interested in using the Python plugin for Orthanc to integrate segmentation tasks that run in the Orthanc Jobs queue.

I read the documentation on https://book.orthanc-server.com/plugins/python.html and thought the procedure would be similar this C++ example: https://github.com/mbarnig/RadioLogic/wiki/OneStepJobPlugin
Subclass orthanc.Job, create an instance and submit it. But I have troubles creating a subclass or instance of orthanc.Job:

class MyJob(orthanc.Job):… → <class ‘TypeError’> type ‘orthanc.Job’ is not an acceptable base type
myJob = orthanc.Job() → <class ‘ValueError’>Expected a pair (pointer, borrowed) in the constructor

Can you please point me to an example how to use this Python interface for Jobs correctly?

Thanks a lot for your time,

Christian

Hello,

As of release 3.1 of the Python plugin, it is not possible to subclass “orthanc.Job” in Python plugins. You’ll have to use C++ plugins for the time being, as explained in the procedure you refer to.

I have added a TODO:
https://hg.orthanc-server.com/orthanc-python/rev/d82eef8c98fc

Sébastien-

Thank you for your answer,

Christian