Getting a live view of connected camera on viewer of Slicer


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.

1 Like

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

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.

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.

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?


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.