Hello, I am studying the Qt Designer and PyQt4 to make a GUI, one of the GUI features will display a DICOM image that I implemented already using VTK and made a simple test on Qt to try to show that image, but I do not know how to link the image to Qt using PyQt, if anyone can help me how to do this, thank you!

PyQt program obtained by pyuic4:

from PyQt4 import QtCore, QtGui

try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s

try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)

class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName(_fromUtf8("Form"))
Form.resize(292, 337)
self.image_vtk = QVTKRenderWindowInteractor(Form)
self.image_vtk.setGeometry(QtCore.QRect(0, 10, 291, 331))
self.image_vtk.setObjectName(_fromUtf8("image_vtk" ))

self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)

def retranslateUi(self, Form):
Form.setWindowTitle(_translate("Form", "Form", None))

from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor

if __name__ == "__main__":
import sys
app = QtGui.QApplication(sys.argv)
Form = QtGui.QWidget()
ui = Ui_Form()
ui.setupUi(Form)
Form.show()
sys.exit(app.exec_())


My test program to open the interface, but not knowing how to link the image:

import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from xob import *

class test(QWidget, Ui_Form):
def __init__(self, parent=None):
super(test, self).__init__(parent)
self.setupUi(self)

app = QApplication(sys.argv)
dlg = test()
dlg.show()
app.exec_()


Finally, the program using VTK opening DICOM image:

import vtk

def show_dicom_image(ndicom):
reader = vtk.vtkDICOMImageReader()
reader.SetFileName(ndicom)
reader.Update()

# Visualize
imageViewer = vtk.vtkImageViewer()
imageViewer.SetInputConnection(reader.GetOutputPor t())
renderWindowInteractor = vtk.vtkRenderWindowInteractor()
imageViewer.SetupInteractor(renderWindowInteractor )
imageViewer.Render()
imageViewer.GetRenderer().ResetCamera()
imageViewer.Render()
renderWindowInteractor.Start()

show_dicom_image('image.dcm')