# Getting a live view of connected camera on viewer of Slicer

**URL:** <https://discourse.slicer.org/t/getting-a-live-view-of-connected-camera-on-viewer-of-slicer/8892>\
**Category:** Support\
**Created:** [October 24, 2019, 8:00pm UTC](https://discourse.slicer.org/t/getting-a-live-view-of-connected-camera-on-viewer-of-slicer/8892 "2019-10-24T20:00:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aalarcon96](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aalarcon96/32/4942_2.png) [@aalarcon96](https://discourse.slicer.org/u/aalarcon96)\
**Post date:** [October 24, 2019, 8:00pm UTC](https://discourse.slicer.org/t/getting-a-live-view-of-connected-camera-on-viewer-of-slicer/8892/1 "2019-10-24T20:00:30Z")

</div>

Hello,

I am building my own loadable module for Slicer. On my module, I have placed a button (using Qt designer) that when I press it I want to see the live view of the camera connected to my computer one of the viewers of 3D Slicer. Is this possible without using OpenIGTLink?

Thank you in advance.

---

<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:** [October 24, 2019, 8:14pm UTC](https://discourse.slicer.org/t/getting-a-live-view-of-connected-camera-on-viewer-of-slicer/8892/2 "2019-10-24T20:14:21Z")

</div>

In recent Slicer Preview Releases, you can use any Python packages. There should be packages that can acquire images from a webcam.

---

<div class="post-metadata">

**Author:** ![aalarcon96](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aalarcon96/32/4942_2.png) [@aalarcon96](https://discourse.slicer.org/u/aalarcon96)\
**Post date:** [October 24, 2019, 8:21pm UTC](https://discourse.slicer.org/t/getting-a-live-view-of-connected-camera-on-viewer-of-slicer/8892/3 "2019-10-24T20:21:17Z")

</div>

Hi Andras,

Thank you for the quick response. Is there a way to use signals and slots on the module’s source files to get the live view on the viewer? Instead of using a python package.

---

<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:** [October 24, 2019, 9:34pm UTC](https://discourse.slicer.org/t/getting-a-live-view-of-connected-camera-on-viewer-of-slicer/8892/4 "2019-10-24T21:34:57Z")

</div>

How to notify availability of a new image (signals/slots, callback functions, observers, polling, etc.) is a minor implementation detail. First you need to decide what interface you would like to access your camera. Options get it from external process via OpenIGTLink, Python multimedia packages, or Qt multimedia package. There are so many options that without knowing more about your application and constraints, it is hard to give more specific advice.

---

<div class="post-metadata">

**Author:** ![aalarcon96](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/aalarcon96/32/4942_2.png) [@aalarcon96](https://discourse.slicer.org/u/aalarcon96)\
**Post date:** [October 25, 2019, 1:44pm UTC](https://discourse.slicer.org/t/getting-a-live-view-of-connected-camera-on-viewer-of-slicer/8892/5 "2019-10-25T13:44:44Z")

</div>

Hi Andras,

So basically I have a realsense RGB-D camera and I want to visualize it on 3D slicer. Eventually I will add more features to the module but this is my starting point. I built Slicer 4.11.0, created a loadable module, designed the GUI on Qt designer, and now am trying to have logic behind the GUI. For our application, OpenIGTLink is going to end up being too slow and from what I have read online most of the people using RealSense cameras and 3D Slicer use OpenIGTLink so I did not know if there were other ways. This is my first time creating a module for Slicer so I am still learning. Are there any specific things you need to know in order to point me in the right direction?

Thanks!

---

<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:** [October 25, 2019, 2:13pm UTC](https://discourse.slicer.org/t/getting-a-live-view-of-connected-camera-on-viewer-of-slicer/8892/6 "2019-10-25T14:13:25Z")

</div>

We use Intel RealSense camera connected to Plus toolkit, connected to 3D Slicer via OpenIGTLink. We can send over all data (RGB image, D image) and/or do data processing in Plus and send the results (tracked object positions, etc.) to Slicer.

If you want to do data acquisition and processing in the same process as your GUI then the programming gets much more complicated, so I would suggest to follow current approach and do these concurrent low-level tasks in another process.
