[vtkusers] VtkImageClip crash with 8.1.1

Axel Kittenberger axkibe at gmail.com
Tue Jul 10 06:07:36 EDT 2018


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20180710/5ff04b73/attachment.html>

More information about the vtkusers mailing list