# Is there an API for RPC?

**URL:** <https://discourse.slicer.org/t/is-there-an-api-for-rpc/21734>\
**Category:** Support\
**Tags:** dicom, networking, api\
**Created:** [February 1, 2022, 2:19pm UTC](https://discourse.slicer.org/t/is-there-an-api-for-rpc/21734 "2022-02-01T14:19:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![swirlsky](https://avatars.discourse-cdn.com/v4/letter/s/ecc23a/32.png) [@swirlsky](https://discourse.slicer.org/u/swirlsky)\
**Post date:** [February 1, 2022, 2:19pm UTC](https://discourse.slicer.org/t/is-there-an-api-for-rpc/21734/1 "2022-02-01T14:19:35Z")

</div>

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: [http://www.osirix-viewer.com/HIS-Integration.pdf](http://www.osirix-viewer.com/HIS-Integration.pdf)

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [February 1, 2022, 9:37pm UTC](https://discourse.slicer.org/t/is-there-an-api-for-rpc/21734/2 "2022-02-01T21:37:39Z")

</div>

We don’t have an exact analog to that but for a while I’ve been working on [SlicerWeb](https://github.com/pieper/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](https://github.com/Slicer/Slicer/pull/5999) but it needs more work.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 2, 2022, 3:21am UTC](https://discourse.slicer.org/t/is-there-an-api-for-rpc/21734/3 "2022-02-02T03:21:31Z")

</div>

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](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#launch-slicer-directly-from-a-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](http://openigtlink.org/).

@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?

---

<div class="post-metadata">

**Author:** ![swirlsky](https://avatars.discourse-cdn.com/v4/letter/s/ecc23a/32.png) [@swirlsky](https://discourse.slicer.org/u/swirlsky)\
**Post date:** [February 2, 2022, 7:04am UTC](https://discourse.slicer.org/t/is-there-an-api-for-rpc/21734/4 "2022-02-02T07:04:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 2, 2022, 1:29pm UTC](https://discourse.slicer.org/t/is-there-an-api-for-rpc/21734/5 "2022-02-02T13:29:59Z")

</div>

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

[![](https://img.youtube.com/vi/60_hzSlptWY/maxresdefault.jpg "Using 3D Slicer with cloud DICOMweb databases") ](https://www.youtube.com/watch?v=60_hzSlptWY)
