VtkImageClip crash with 8.1.1

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

VtkImageClip crash with 8.1.1

Axel Kittenberger

I'm somewhat confused why below code crashes (buserror).

I know I can "fix" this by calling reader.Update( ) or reader.UpdateWholeExtent( ); before engaging the whole pipeline by the viewer, however this is a simplified case of a whole set of big images for which I would not have the memory to hold them all in memory before clipping. And I know I would have to call ClipDataOn() for it to actually easy memory use, but I left it away for simplicity of the minimal use. Also calling clip.Update( ) makes an instance crash (segfault) before the viewer is even setup.

Below sample works with 6.3.0 tough. Identical C++ control application has the same effect.
from vtk import vtkJPEGReader
from vtk import vtkImageViewer2
from vtk import vtkRenderWindowInteractor
from vtk import vtkImageClip
from vtk import vtkVersion

print( vtkVersion.GetVTKSourceVersion( ) )

reader = vtkJPEGReader( )
reader.SetFileName( 'test.jpg' )
reader.UpdateInformation( )
clip = vtkImageClip( )
clip.SetInputConnection( reader.GetOutputPort( ) )
clip.SetOutputWholeExtent( 0, 10, 0, 10, 0, 1 )
viewer = vtkImageViewer2( )
viewer.SetInputConnection( clip.GetOutputPort( ) )
interactor = vtkRenderWindowInteractor( )
viewer.SetupInteractor( interactor )
viewer.Render( )
viewer.GetRenderer( ).ResetCamera( )
viewer.Render( )
interactor.Start( )

I really have no idea what causes this.

Kind regards, Axel

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe: