Is there an API for RPC?

I’m wondering if there’s a way to instruct slicer from a remote application to load e.g. a DICOM Study or do other operations.

Like OsiriX has one:

We don’t have an exact analog to that but for a while I’ve been working on SlicerWeb to embed a web server that exposes slicer functionality as a service. Basically you can define routes in the server and map them to python code to make Slicer do whatever you want. I’ve been working to get it in the core in this PR but it needs more work.

In addition to SlicerWeb’s REST API, you can also use custom URL handlers (for example, to load a data set from the web browser), and for high-efficiency real-time data transfer (for example real time streaming of tool positions coming from surgical navigation systems to Slicer) you can use OpenIGTLink.

@swirlsky can you tell a bit more about your use case? What is your overall goal and what actions would you like Slicer to perform?

Thank you for your quick replies. My goal is to instruct Slicer from a web app to load a DICOM study from a PACS. As I understand, after I’ve configured a DICOM connection in Slicer, I could use the slicer: custom URL protocol to achieve this. I will give it a try. For a more sophisticated controlling from the browser, SlicerWeb sounds really promising.

Yes, custom URL is the way to go for that, it is already set up with Kheops:

1 Like