[vtkusers] Again python debugging
Willi Huber
surfersparadise85-vtk at yahoo.com
Mon Jan 14 22:55:22 EST 2013
Hello all,
I am trying to do some new stuff and I am again hitting the debugging barriers of vtk in python.
My code:
file = "test.mhd"
reader = vtk.vtkMetaImageReader()
reader.SetFileName(file)
reader.Update() #just for checking because I had an observer attached to reader
iren = QVTKRenderWindowInteractor(self.widget)
ren = vtk.vtkRenderer()
iren.GetRenderWindow().AddRenderer(ren)
viewer = vtk.vtkResliceImageViewer()
viewer.SetRenderWindow(iren.GetRenderWindow())
viewer.SetRenderer(ren)
viewer.SetupInteractor(iren)
viewer.SetInput(reader.GetOutput())
viewer.SetSlice(50)
viewer.SetColorWindow(2000.0)
viewer.SetColorLevel(1000.0)
layout = QtGui.QVBoxLayout()
layout.addWidget(iren)
self.slider = QtGui.QSlider(Qt.Horizontal, self.widget)
layout.addWidget(self.slider)
self.widget.setLayout(layout)
iren.Initialize()
iren.Start()
I can see the image in the first place.
When I use the right mouse button everything is fine and I can zoom in and out but when using the left mouse button the app suddenly freezes and the debugging window of Win7 appears - not the VTK window. It is sth. with a malloc at least this is what the debugger told me or rather stepped in.
I tried using the Error Observer suggested by David and mined every object I've access to. I also used the vtk.vtkFileOutputWindow() without any success. No file was written.
(The slider isn't currently attached to any object so you can ignore it.) Am I doing sth. wrong with the initialization?
Can someone help me with this?
Cheers,
Willi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130115/47176aa0/attachment.htm>
More information about the vtkusers
mailing list