Hello there,
So, I just started to develop Orthanc plugin
I have configured Orthanc server to store dicom files in the file system,
In the scenario that I’m working at, I’d like to get the actual file path to the dicom files that getting received by orthanc server.
I’ve already registered my callback functions via OrthancPluginRegisterOnStoredInstanceCallback() , OrthancPluginRegisterOnChangeCallback() methods.
Is there any REST / Function that i coud pass resourceId or instanceId to them and get the file path ?
Thanks
Hello,
Because of the presence of “storage plugins”, you can’t make the assumption that the DICOM files will always be directly accessible on the filesystem:
http://book.orthanc-server.com/faq/orthanc-storage.html#direct-access
You should use the “OrthancPluginGetDicomForInstance()” function of the Orthanc SDK to that end:
http://sdk.orthanc-server.com/group__Orthanc.html#gaf10589df627087401cd7e33b52db4d0f
The REST API also has the “/instances/{id}/file” URI to retrieve the raw DICOM file:
http://book.orthanc-server.com/users/rest.html#downloading-images
HTH,
Sébastien-
Thank you Sebastien,
So based on your description I decided to stick with design and use normal/available methods to access dicom data.
I just had another question regarding to plugin development,
As far as Orthanc is developed in multithreaded fashion, I was wondering do i need to care about generic codes I’m going to use in my plugin library (callback functions). In another word, the callback function calls are safely handled before hand or do i need to handle them manually. For example in OnStored() callback function, that there could be so many concurrent requests from clients. Is there any mutex/lock mechanism has been developed arround the function / variables or not ? generally could you please tell me what considerations are needed while developing plugin ?
Thanks.
Hello,
Sorry for the delay.
As far as Orthanc is developed in multithreaded fashion, I was wondering do i need to care about generic codes I’m going to use in my plugin library (callback functions). In another word, the callback function calls are safely handled before hand or do i need to handle them manually. For example in OnStored() callback function, that there could be so many concurrent requests from clients. Is there any mutex/lock mechanism has been developed arround the function / variables or not ? generally could you please tell me what considerations are needed while developing plugin ?
The plugins must be able with concurrent calls to all its callbacks, and must implement the required locking mechanism if need be.
The only exception is callbacks registered using the “OrthancPluginRegisterRestCallback()” function, that are already protected by a mutex in the Orthanc core.
HTH,
Sébastien-