[vtkusers] How to display image data with anisotropic (non-square) voxels/pixels

kent williams nkwmailinglists at gmail.com
Thu Mar 22 19:30:59 EDT 2007


I'm using KWWidgets to develop a medical image viewer application.  What I'm
trying to display is brain scans from an MRI scanner.

For the KWWidgets heads, I'm using a vtkKWRenderWidget, which is a
collection of VTK objects in order to render the brain volume as a series of
2D slices.

For VTK people, this uses a combination of a vtkImageViewer2 and a
vtkRenderWindow.

The problem comes from the fact that each image voxel is not square.  In
each slice, a pixel represents a 1mm by 1mm square, but the inter-slice
distance is 3mm.

So when I run my program one orthogonal view -- i.e. looking at a slice in
the XY plane it is proportioned correctly.  But if I look at a different
plane (XZ or YZ) the pixels appear squashed or stretched in either the X or
Y direction.

I attempted to fix this by using the vtkViewport::SetPixelAspect method on
the vtkRenderer.  This appears to do nothing at all.

I spent quite some time with Google trying to figure out if anyone else had
solved this problem, with no luck.  I read a lot of messages indicating that
SetPixelAspect was basically broken in 2003 or 2004, but never saw anywhere
that it was fixed.

Can anyone give me a clue as to how to fix this?  This is radiological data
so it isn't acceptable to resample the image data into isotropic voxels.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070322/dd9606e5/attachment.htm>


More information about the vtkusers mailing list