[vtkusers] Again python debugging
Willi Huber
surfersparadise85-vtk at yahoo.com
Wed Jan 16 06:07:48 EST 2013
Anyone?
------------------------------
Willi Huber schrieb am Di., 15. Jan 2013 04:55 MEZ:
>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
More information about the vtkusers
mailing list