[vtkusers] Last gasp attempt for help with SetPixelAspect

Mathieu Malaterre Mathieu.Malaterre at creatis.insa-lyon.fr
Tue Sep 2 14:26:34 EDT 2003


Greg Scott wrote:
> If anyone there knows how to get SetPixelAspect to work (any version of
> VTK), please could they let me know. I've written to the list before about
> this, and searched the archives, but have found no clues.
> 
Hi Greg,

	You are right, I also have had some problem to display an anisotropic 
image. So please do a 'cvs update' of VTK, and change 
VTK/Rendering/vtkOpenGLCamera.cxx

	You'll find a modified version here:

http://www.creatis.insa-lyon.fr/~malaterre/vtk/vtkOpenGLCamera.cxx

	Also please have a look at:

http://public.kitware.com/cgi-bin/cvsweb.cgi/VTK/Rendering/vtkOpenGLCamera.cxx.diff?r1=1.54&r2=1.55&cvsroot=VTK

Let me know how it works,
mathieu
Ps: Here is the Python script I used for testing:

#######################################
import vtk
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()

reader = vtk.vtkPNGReader ()
reader.SetDataSpacing (0.8, 0.8, 1.5)
reader.SetFileName ( VTK_DATA_ROOT + "/Data/fullhead15.png")

iren = vtk.vtkRenderWindowInteractor()

viewer = vtk.vtkImageViewer2()

viewer.GetRenderer().SetPixelAspect( 1, 1.5)
#viewer.GetRenderer().ComputeAspect()

viewer.SetupInteractor (iren)
viewer.SetInput ( reader.GetOutput() )

iren.Initialize()
iren.Start()
#######################################




More information about the vtkusers mailing list