[vtk-developers] reproducible vtkImagePlaneWidget(?) bug
Charl P. Botha
c.p.botha at its.tudelft.nl
Fri May 9 20:24:53 EDT 2003
On Sat, May 10, 2003 at 02:20:26AM +0200, Charl P. Botha wrote:
> I have attached a short VTK Python script which bugs badly under Windows
> (but not under Linux). In short, if one connects something with an empty
This time, I'm actually going to attach it.
--
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/
-------------- next part --------------
import vtk
# change this to suit your setup
VTK_DATA_ROOT = 'c:/build/VTKData'
# Start by loading some data.
v16 = vtk.vtkVolume16Reader()
v16.SetDataDimensions(64, 64)
v16.SetDataByteOrderToLittleEndian()
v16.SetFilePrefix(VTK_DATA_ROOT +
"/Data/headsq/quarter")
v16.SetImageRange(1, 93)
v16.SetDataSpacing(3.2, 3.2, 1.5)
thresh = vtk.vtkImageThreshold()
thresh.ThresholdBetween(2000,65535)
thresh.SetInValue(1.0)
thresh.SetOutValue(0.0)
#thresh.SetInput(v16.GetOutput())
renderWindow = vtk.vtkRenderWindow()
renderer = vtk.vtkRenderer()
renderer.SetBackground(0.5, 0.5, 0.5)
renderWindow.AddRenderer(renderer)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renderWindow)
# initialise an IPW
ipwX = vtk.vtkImagePlaneWidget()
ipwX.DisplayTextOn()
thresh.Update() # the IPW does need metadata
ipwX.SetInput(thresh.GetOutput())
ipwX.SetPlaneOrientationToXAxes()
# activate it
ipwX.SetInteractor(iren)
ipwX.On()
iren.Initialize()
renderWindow.Render()
iren.Start()
More information about the vtk-developers
mailing list