[vtkusers] Repositioning Image within Render Window

David Doria daviddoria at gmail.com
Wed Oct 20 18:33:55 EDT 2010


On Wed, Oct 20, 2010 at 6:31 PM, David Gobbi <david.gobbi at gmail.com> wrote:

> Hi Alexis,
>
> The vtkImageActor is the most common way of displaying an image.  It
> assumes that the image data is already in the correct coordinate
> system (and if the image is not yet in the right coordinate system,
> then its Origin and Spacing can be adjusted with
> vtkImageChangeInformation).  That is usually the best method for
> displaying an image.  If you try displaying an image with vtkTexture
> instead, then you have to take care of all the details like aspect
> ratio, position, texture coords, etc. yourself.
>
> And, as John said, you must also consider the camera, because it is
> what determines how the "World Coordinates" of the 3D scene are
> translated into view that you see on the computer screen.  For 2D
> image viewing, you usually want to set ParallelProjectionOn() and use
> SetParallelScale() to set how large the view is, in world coordinates.
>  Then set the camera FocalPoint to the center of your image, set the
> camera Position about 1000mm away from the focal point (i.e. looking
> towards it), and then set the ViewUp() so that the image will be
> correctly oriented on the screen.
>
>   David
>

Here is an example of using an ImageActor as David G. suggested:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/InteractWithImage
<http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/InteractWithImage>
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101020/bfb9ca69/attachment.htm>


More information about the vtkusers mailing list