[vtkusers] disappearing act

rharder at uiuc.edu rharder at uiuc.edu
Tue Feb 10 23:37:31 EST 2004


Hi, 
I've finally gotten my array to show up as an image.  The only
problem is, the object within the image window disappears if
another window is placed on top of the image window.
vtkpython code follows.

data = vtk.vtkDoubleArray()
data.SetVoidArray(datastring,len(datastring)/data.GetDataTypeSize(),1)
data.CreateDefaultLookupTable()

id = vtk.vtkImageData()
id.GetPointData().SetScalars(data)
id.SetDimensions(256,256,1)
#id.SetScalarType(vtk.VTK_UNSIGNED_CHAR)
id.SetSpacing(1.0,1.0,0.0)
id.SetOrigin(0.0,0.0,0.0)

viewer = vtk.vtkImageViewer()
viewer.SetInput( id )
viewer.SetColorWindow(1)
viewer.SetColorLevel(.5)
viewer.Render()



More information about the vtkusers mailing list