[vtkusers] slicing through vtkImagedata

Matthias Zangl zangl at ism-austria.at
Thu Jun 7 11:21:36 EDT 2001


Hello everybody,

I've written a program that loads some slices (TIFF), stores them in an
imagedata-object (reader.GetOutput). And I try to get slices through every
axes (x,y,z) as well as free cutted slices.

I used the following python-code:

---
from libVTKCommonPython import *
from libVTKGraphicsPython import *
from WindowLevelInterface import *

reader = vtkTIFFReader()
reader.SetFilePrefix("C:\\source\\dicoms\\daten\\bud\\raw\\i.")
reader.SetFilePattern("%s%.3d.tif")
reader.SetDataExtent(0,512,0,512,1,120)
reader.Update()

transform = vtkTransform()
transform.RotateX(90)

reslice = vtkImageReslice()
reslice.SetInput(reader.GetOutput())
reslice.SetResliceTransform(transform)
reslice.SetInterpolationModeToLinear()
reslice.SetOutputSpacing(1,1,1)

viewer = vtkImageViewer()
viewer.SetInput(reslice.GetOutput())
viewer.SetColorWindow(256)
viewer.SetColorLevel(127.5)
viewer.SetZSlice(0)
viewer.Render()

WindowLevelInterface(viewer)
---


But, these lines of code worked well with the binary-installation of vtk
3.2. Now I checked out the actual nightly build and it isn't working with
that one. I suppose that the RotateX-method rotates the voxels out of the
visible area. When I use the mirror-function (Reslice.Mirror) I can see that
my object was turned around 90° but it is displayed twice and a half.

I assume that the transformation is working, but turning around the wrong
point, origin?

Does anything have changed regarding the transformation, or image-reslices?

Thanks in advance for your help!

Matthias





More information about the vtkusers mailing list