[vtkusers] vtk window closes unexpectedly in vtkImageAccumulate

Lizeth Castellanos castellanoslizan at gmail.com
Mon Dec 1 19:23:55 EST 2014


Hello vtk-users!


I'm using the TestAccumulate.py from
http://vtk.org/gitweb?p=VTK.git;a=blob;f=Imaging/Core/Testing/Python/TestAccumulate.py;h=40054f0e43dbf7914f911815172d8c02378826ee;hb=HEAD

I don't get see the result. The test ran without  compilation errors, but
the vtk window closes unexpectedly.

Any idea?

Thanks!

-Lizeth

My Code here:

#!/usr/bin/env python
import vtk
from vtk.test import Testing

reader = vtk.vtkPNGReader()
reader.SetFileName("/home/user/Downloads/fullhead15.png")

smooth = vtk.vtkImageGaussianSmooth()
smooth.SetDimensionality(2)
smooth.SetStandardDeviations(1,1)
smooth.SetInputConnection(reader.GetOutputPort())

imageAppend = vtk.vtkImageAppendComponents()
imageAppend.AddInputConnection(reader.GetOutputPort())
imageAppend.AddInputConnection(smooth.GetOutputPort())

clip = vtk.vtkImageClip()
clip.SetInputConnection(imageAppend.GetOutputPort())
clip.SetOutputWholeExtent(0,255,0,255,20,22)

accum = vtk.vtkImageAccumulate()
accum.SetInputConnection(clip.GetOutputPort())
accum.SetComponentExtent(0,255,0,255,0,0)
accum.SetComponentSpacing(12,12,0.0)
accum.Update()

viewer = vtk.vtkImageViewer()
viewer.SetInputConnection(accum.GetOutputPort())
viewer.SetColorWindow(4)
viewer.SetColorLevel(2)
viewer.Render()


--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20141201/c3c02178/attachment.html>


More information about the vtkusers mailing list