[vtk-developers] A new way to look at images

David Gobbi david.gobbi at gmail.com
Fri Jan 21 18:53:16 EST 2011


Hi All,

I've been experimenting with a new way of rendering 3D images in VTK.
So far, it is working fairly well.  Here is a rough description of the
new VTK classes I've written:

vtkImage - a new prop for image viewing, analogous to vtkVolume and vtkActor
vtkImageProperty - holds the lookup table, window/level, etc.
vtkImageMapper3D - a new mapper that does image reslicing and texturing

Using these classes is very simple: just set up the camera, and the
vtkImage object will automatically display the slice at the camera
focal point.  To show a different slice, just move the focal point so
that it lies at a different position in the 3D image.  To slice in a
different orientation, rotate the camera around the focal point.  In
other words, the slicing is completely controlled by the camera.  This
makes everything work nicely with the VTK interactors, and also
simplifies the intermixing of images and geometry.

My reason for making this class is that I've seen plenty of users on
the list who struggle with vtkImageReslice and with vtkImageViewer.  I
wanted to make it as easy to view an image in VTK as it is to view an
actor. I have the code on my github account
git://github.com/dgobbi/VTK.git in the branch "image-prop"
http://github.com/dgobbi/VTK/tree/image-prop

The code includes a modified vtkInteractorStyleImage class that has
new interactions for rotating the camera with shift-leftbutton (for
oblique slicing) and for adjusting the focal point with
shift-middlebutton (for slicing through the image).  There is also a
python example in Examples/ImageProcessing/Python/ImageMapper3D.py.
All of this is still preliminary development, but so far I haven't
encountered any show-stopping bugs.

Please let me know what you think.  I'll try to make a wiki page with
more details next week.

 - David



More information about the vtk-developers mailing list