Python Plugin for Orthanc

685 views
Skip to first unread message

Vesa Alexandru

unread,
Aug 13, 2022, 3:27:03 AM8/13/22
to Orthanc Users
Hello !
I'm trying to use python plugins.

Right now i'm trying to extend the Rest Api for listening on changes. I'm curious. Is there anywhere any documentation regarding to what can be used?

For example:
orthanc.RestApiGet('/instances')

Where should I find the info about this?

Thanks,
Alex

Stephen Douglas Scotti

unread,
Aug 13, 2022, 3:41:48 AM8/13/22
to Orthanc Users
There is some information about that here in the Orthanc Book:  https://book.orthanc-server.com/plugins/python.html?highlight=onchange

Not sure, but in OrthancCPlugin.h file there is this.  Those might be the events you can captture.

typedef enum
  {
    OrthancPluginChangeType_CompletedSeries = 0,    /*!< Series is now complete */
    OrthancPluginChangeType_Deleted = 1,            /*!< Deleted resource */
    OrthancPluginChangeType_NewChildInstance = 2,   /*!< A new instance was added to this resource */
    OrthancPluginChangeType_NewInstance = 3,        /*!< New instance received */
    OrthancPluginChangeType_NewPatient = 4,         /*!< New patient created */
    OrthancPluginChangeType_NewSeries = 5,          /*!< New series created */
    OrthancPluginChangeType_NewStudy = 6,           /*!< New study created */
    OrthancPluginChangeType_StablePatient = 7,      /*!< Timeout: No new instance in this patient */
    OrthancPluginChangeType_StableSeries = 8,       /*!< Timeout: No new instance in this series */
    OrthancPluginChangeType_StableStudy = 9,        /*!< Timeout: No new instance in this study */
    OrthancPluginChangeType_OrthancStarted = 10,    /*!< Orthanc has started */
    OrthancPluginChangeType_OrthancStopped = 11,    /*!< Orthanc is stopping */
    OrthancPluginChangeType_UpdatedAttachment = 12, /*!< Some user-defined attachment has changed for this resource */
    OrthancPluginChangeType_UpdatedMetadata = 13,   /*!< Some user-defined metadata has changed for this resource */
    OrthancPluginChangeType_UpdatedPeers = 14,      /*!< The list of Orthanc peers has changed */
    OrthancPluginChangeType_UpdatedModalities = 15, /*!< The list of DICOM modalities has changed */
    OrthancPluginChangeType_JobSubmitted = 16,      /*!< New Job submitted */
    OrthancPluginChangeType_JobSuccess = 17,        /*!< A Job has completed successfully */
    OrthancPluginChangeType_JobFailure = 18,        /*!< A Job has failed */

    _OrthancPluginChangeType_INTERNAL = 0x7fffffff
  } OrthancPluginChangeType;

Stephen Scotti

Alain Mazy

unread,
Aug 16, 2022, 8:35:53 AM8/16/22
to Stephen Douglas Scotti, Orthanc Users
Hi,

Unfortunately, we don't have a reference documentation of the python SDK.

You can get a list of classes and functions here.  But the best resources are all samples from the orthanc-book python page and from this repo.

HTH

Alain

--
You received this message because you are subscribed to the Google Groups "Orthanc Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orthanc-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/orthanc-users/fdf4032a-1fee-47f3-ba84-e71991c8471bn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages