Resizing vtkImageWindow vs. Resizing vtkRenderWindow

David Gobbi dgobbi at irus.rri.on.ca
Fri Nov 19 20:20:39 EST 1999


Hi Brian,

There are two ways of doing what you are looking for.
1) use a vtkRenderWindow with parallel projection, and display 
   your images on texture maps
2) use a vtkImageWindow, but use either vtkImageResample or
   vtkImageReslice to scale the image data -- see the 
   example contrib/examplesPython/SliceViewerWidget.py 
   in recent nightly releases to get an idea of the math involved.

 - David

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

On Fri, 19 Nov 1999, Brian Alexander Todd wrote:

> I have a question about resizing windows in vtk.  vtkRenderWindow
> seems to respond to size events automatically by scaling all
> of the actors to the new screen coordinates.  vtkImageWindow does
> not.  I assume that this behavior is used because images have 
> implicit geometry and the window is therefore expected to conform
> to the image geometry.
> 
> For my application, I would like to implement some default rescaling
> of images (the images are subordinate to the window).  I would probably
> have the image maximize its dimensions to fill the window while 
> maintaining the appropriate aspect ratio.  What is the easiest way
> to go about this.  It would be best if it could occur at the level
> of vtkImageWindow (since I already have a reference to this and
> it assumes little), maybe if at the vtkImager level if vtkImageWindow
> is not possible, but preferably not at the level of individual image
> sources or something.  
> 
> What is the best way to go about this.
> 
> Thanks,
> Brian
> 
>            _____________________________________________________
>   ________|                                                     |________
>   \       |   Brian Todd                email: bat5 at po.cwru.edu |       /
>    \      |   N.O.B.L.                   home: (216) 791-2407   |      /
>     \     |   C.W.R.U.                 office: (216) 368-4209   |     /
>     /     |   Cleveland, OH 44106         fax: (216) 368-4969   |     \
>    /      |_____________________________________________________|      \
>   /___________)                                              (__________\
> 
> 
> -----------------------------------------------------------------------------
> 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.
> -----------------------------------------------------------------------------
> 



-----------------------------------------------------------------------------
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