How to use orthanc.Job in Python plugin

123 views
Skip to first unread message

Christian Bauer

unread,
May 24, 2021, 9:19:42 AM5/24/21
to Orthanc Users
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


Sébastien Jodogne

unread,
May 28, 2021, 4:54:45 AM5/28/21
to Orthanc Users
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:

Sébastien-

chri...@gmail.com

unread,
May 28, 2021, 9:08:13 AM5/28/21
to Orthanc Users
Thank you for your answer,

Christian

Reply all
Reply to author
Forward
0 new messages