# integrating VTK with QT

**URL:** https://discourse.vtk.org/t/integrating-vtk-with-qt/15432
**Category:** Support
**Created:** [March 26, 2025, 12:44pm UTC](https://discourse.vtk.org/t/integrating-vtk-with-qt/15432 "2025-03-26T12:44:02Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Emmynabs](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/e/ee7513/32.png) [@Emmynabs](https://discourse.vtk.org/u/Emmynabs)
#### Post date: [March 26, 2025, 12:44pm UTC](https://discourse.vtk.org/t/integrating-vtk-with-qt/15432/1 "2025-03-26T12:44:02Z")

</div>

I need assistance integrating VTK with QT, i have tried integrating them but my QT buttons do not work when i run the application. images do not render when i click the buttons to render them.

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [March 26, 2025, 10:15pm UTC](https://discourse.vtk.org/t/integrating-vtk-with-qt/15432/2 "2025-03-26T22:15:01Z")

</div>

Have a look at [MinimalQtVTKApp](https://examples.vtk.org/site/Cxx/Qt/MinimalQtVTKApp/), it uses a button called `Randomize`.

---

<div class="post-metadata">

### Author: ![Mordrago](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mordrago/32/8974_2.png) [@Mordrago](https://discourse.vtk.org/u/Mordrago)
#### Post date: [March 27, 2025, 1:39pm UTC](https://discourse.vtk.org/t/integrating-vtk-with-qt/15432/3 "2025-03-27T13:39:09Z")

</div>

Ok, but QT at Python or C++? Anyway you shoudl use QVTKRenderWindowInteractor to integrate VTK with QT, eq:

```auto
    def __init__ (
            self, parent: QVTKRenderWindowInteractor):
        """Create new Viewer instance."""
        self.ren = vtkRenderer()

        self.wren = parent.GetRenderWindow()
        self.iren = self.wren.GetInteractor()

```

And next just pin buttons with propper slots and singals.

---

<div class="post-metadata">

### Author: ![Emmynabs](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/e/ee7513/32.png) [@Emmynabs](https://discourse.vtk.org/u/Emmynabs)
#### Post date: [March 30, 2025, 7:20am UTC](https://discourse.vtk.org/t/integrating-vtk-with-qt/15432/4 "2025-03-30T07:20:25Z")

</div>

i am using C++ sorry for the late response, i have just been dealing with an emergency situation for days now

---

<div class="post-metadata">

### Author: ![Emmynabs](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/e/ee7513/32.png) [@Emmynabs](https://discourse.vtk.org/u/Emmynabs)
#### Post date: [March 30, 2025, 7:21am UTC](https://discourse.vtk.org/t/integrating-vtk-with-qt/15432/5 "2025-03-30T07:21:03Z")

</div>

okay thank you, i will take a look at that

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [March 30, 2025, 7:45am UTC](https://discourse.vtk.org/t/integrating-vtk-with-qt/15432/6 "2025-03-30T07:45:42Z")

</div>

No problems.

---

<div class="post-metadata">

### Author: ![Emmynabs](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/e/ee7513/32.png) [@Emmynabs](https://discourse.vtk.org/u/Emmynabs)
#### Post date: [March 30, 2025, 7:53am UTC](https://discourse.vtk.org/t/integrating-vtk-with-qt/15432/7 "2025-03-30T07:53:42Z")

</div>

would take a look at it now then give you feedback.

---

<div class="post-metadata">

### Author: ![Emmynabs](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/e/ee7513/32.png) [@Emmynabs](https://discourse.vtk.org/u/Emmynabs)
#### Post date: [March 30, 2025, 8:50am UTC](https://discourse.vtk.org/t/integrating-vtk-with-qt/15432/8 "2025-03-30T08:50:58Z")

</div>

i have checked it out, is it possible to build a DICOM volume rendering application on top of this code or is there any other example i should take a look at?

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [April 1, 2025, 3:17am UTC](https://discourse.vtk.org/t/integrating-vtk-with-qt/15432/9 "2025-04-01T03:17:24Z")

</div>

> possible to build a DICOM volume rendering application

A good example is 3D Slicer: it uses VTK+Qt for loading and rendering DICOM images, segmentation objects, meshes, transforms, etc. All the usual features of all medical image viewers, all free, open-source, VTK-based. You can use as is, in C++ and/or Python, or use it as a kit to [build your own custom application](https://www.kitware.com/slicercat-creating-custom-applications-based-on-3d-slicer/) (this is what most companies do), or copy-paste what you need into your own application (tempting, especially if you already invested into developing your own application; but probably not the best choice in the long term, as you don’t automatically benefit from all the platform improvements continuously contributed by others).

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [April 1, 2025, 8:07am UTC](https://discourse.vtk.org/t/integrating-vtk-with-qt/15432/10 "2025-04-01T08:07:50Z")

</div>

Thankyou for looking at this. Emmanuel, this would be the best approach for DICOM volume rendering.
