[vtkusers] python vtk BadRequest
Eleftherios Garyfallidis
garyfallidis at gmail.com
Tue Jul 19 12:21:48 EDT 2011
Dear vtk users,
I am getting the following error for some time using python-vtk with
libvtk5.4 in ubuntu 10.10
X Error of failed request: BadRequest (invalid request code or no such
operation)
Major opcode of failed request: 0 ()
Serial number of failed request: 30
Current serial number in output stream: 32
This crashing error comes randomly usually after I have executed the
following function for a few times.
def show(ren,title='dipy.viz.fvtk',size=(300,300),png_magnify=1):
''' Show window
'''
ren.ResetCamera()
window = vtk.vtkRenderWindow()
window.AddRenderer(ren)
window.SetWindowName(title)
window.SetSize(size[0],size[1])
style=vtk.vtkInteractorStyleTrackballCamera()
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(window)
iren.SetPicker(picker)
def key_press(obj,event):
key = obj.GetKeySym()
if key=='s' or key=='S':
print('Saving image...')
renderLarge = vtk.vtkRenderLargeImage()
renderLarge.SetInput(ren)
renderLarge.SetMagnification(png_magnify)
renderLarge.Update()
writer = vtk.vtkPNGWriter()
writer.SetInputConnection(renderLarge.GetOutputPort())
writer.SetFileName('fvtk.png')
writer.Write()
print('Look for fvtk.png in your current working directory.')
iren.AddObserver('KeyPressEvent',key_press)
iren.SetInteractorStyle(style)
iren.Initialize()
picker.Pick(85, 126, 0, ren)
window.Render()
iren.Start()
I would appreciate very much any help on that issue. Please let me know if
you have any ideas.
Best wishes,
Eleftherios
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110719/b8a1534e/attachment.htm>
More information about the vtkusers
mailing list