Resizing vtkImageWindow vs. Resizing vtkRenderWindow

David Gobbi dgobbi at irus.rri.on.ca
Mon Nov 22 10:24:02 EST 1999


Hi Brian,

As long as your graphics card can handle 512x512 textures (most can),
there is no performance advantage to using the vtkImageWindow.

On just about any 3D accelerated graphics card, uploading textures
is just as fast as pasting an image of the same size.  Add to this
the fact that zooming and interpolation are nearly free with
accelerated texture mapping, while they are quite expensive if done 
by the CPU.

The examples to check are TPlane.tcl, resampledTexture.tcl, and
contrib/TextureReslice.tcl.  (Compare the latter to TextureReslice.py
to see why Python is a much better language for this stuff than
Tcl is ;)

 - David

On Mon, 22 Nov 1999, Brian Alexander Todd wrote:

> Thanks David.  
> 
> Quick recap.  I had asked how to implement some default
> resizing behavior for images in vtk.  David's responses
> are: (I have a couple followup questions afterwards)
> 
> At 08:20 PM 11/19/99 -0500, David Gobbi wrote:
> >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
> >
> 
> 
> I think I am going to go with the first option,
> since I would prefer to work at the window level.  Will
> I take a huge hit on efficiency since I'm moving away
> from the image window, to the 3D pipeline?  I'm dealing
> with images typically of 512x512 pixels and only one 
> z-slice but I would like everything to run reasonably
> smoothly on the average PC.  Is TPlane.tcl a good example 
> of parallel projection, and displaying images on texture
> maps or should I look somewhere else?
> 
> Thanks,
> Brian Todd
> 
> 
> My original message
> 
> >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



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