[vtkusers] vtkImageViewer2 and SetZSlice

lzy lzyhm at 263.net
Fri Apr 18 05:03:09 EDT 2003

I try to show a vtkImageData slice by slice as following code:

vtkImageReader reader
  reader SetDataByteOrderToLittleEndian
  reader SetDataExtent 0 63 0 63 1 64
  reader SetFilePrefix "$VTK_DATA_ROOT/Data/headsq/quarter"
  reader SetDataMask 0x7fff
  reader SetDataSpacing 1.6 1.6 1.5

vtkImageViewer2 viewer
viewer SetInput [reader GetOutput]
viewer SetColorWindow 1200
viewer SetColorLevel 1000
viewer SetZSlice 40

viewer Render

but I can't get correct result when I change the parameter of SetZSlice
vtkImageViewer2 always display the same slice.

When i change vtkImageViewer2 to vtkImageViewer, the result is correct.

The result is the same for vtk4.0 and vtk4.2.

Why? help me, thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030418/71becbac/attachment.htm>

More information about the vtkusers mailing list