aspect ratio - SetSpacing()..

David Gobbi dgobbi at irus.rri.on.ca
Mon Dec 6 10:05:43 EST 1999


Kalpathi,

The Spacing and Origin of vtkStructuredPoints (or vtkImageData) is
ignored when the images are drawn -- an image pixel maps directly
to a screen pixel (or to a texel, if you are doing texture mapping).

If you are drawing the images via a vtkImager (or vtkImageViewer),
then you must resample the images via vtkImageResample or vtkImageReslice.
If you are drawing the images via texture maps, you have to set the
vtkPlaneSource you are texture mapping onto to the correct dimensions.

 - David

--
  David Gobbi, MSc                    dgobbi at irus.rri.on.ca
  Advanced Imaging Research Group
  Robarts Research Institute, University of Western Ontario

On Mon, 6 Dec 1999, K.R.Subramanian wrote:

> 
> In drawing images whose pixel dimensions are not necessarily unity, will
> setting the spacing using
> SetSpacing (of vtkStructuredPoints) ensure the image will be drawn at
> the correct aspect ratio? I have been
> trying to do that but the images are distorted. For instance,
> 
> image->SetDimensions (256,70)
> image->SetSpacing (0.78,1.5)
> 
> I am hoping to see an image of size 200 (256*0.78) by 105 (70*1.5).
> 
> Am I doing something wrong above. The images seem squished in the Y
> direction.
> 
> Thanks.
> 
>     -- krs
> 
> --
> K.R.Subramanian                           Phone: (704) 547-4872
> Department of Computer Science            FAX:   (704) 547-3516
> UNC Charlotte                             Email: krs at cs.uncc.edu
> 9201 Univ. City Blvd.                     WWW: http://www.cs.uncc.edu/~krs
> Charlotte, NC 28223-0001
> 
> 
> 



-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------




More information about the vtkusers mailing list