Goodwin & Obada,<br><br>Thanks for your replies. I will play around with it today and if no joy, I will stick with vtkImageViewer.<br><br>Thanks again :)<br><br><div><span class="gmail_quote">On 17/08/06, <b class="gmail_sendername">
Obada Mahdi</b> <<a href="mailto:omahdi@gmx.de">omahdi@gmx.de</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Anja!
<br><br>Anja Ende wrote:<br>[undistorted display of preprocessed image using vtkImageViewer2]<br>> Another curious thing is that if I do not call ResetCamera in my derived<br>> class, the image gets displayed with a very high zoom factor!
<br>><br>> I really do not understand what is happening with this function here.<br>> Please, if anyone has some thoughts on this, please please share!<br><br>Some thoughts, coming up:<br><br>According to the documentation, vtkImageViewer2 provides a simple 3D
<br>scenario that places an vtkImageActor into the scene (facing the<br>camera). In particular, displaying an image this way involves other<br>(projection) transforms defined by camera parameters, just like with any<br>other 3D scenario.
<br><br>>> It seems to be the ResetCamera() function that rescales the image.<br><br>What you are experiencing as "auto-scaling" is indeed a result of<br>ResetCamera(), which tries to adjust camera parameters in a way such
<br>that all actors are visible (or, more precisely, such that the enclosing<br>sphere of any actor's bounding box fits into the resulting view frustrum<br>-- that's why a single rectangular image still doesn't max out the
<br>render window in either dimension).<br><br>Without an initial call to ResetCamera(), camera defaults are used,<br>which, in conjunction with your image dimensions and spacing, result in<br>that "very high zoom factor" you mentioned.
<br><br>The vtkImageViewer wrapper class, on the other hand, uses 2D<br>actors/mappers, so there is no projection transform to bother with.<br><br><br>I guess the "right" way to deal with this depends on what you want to
<br>do. If you just want to display image data exactly as produced by your<br>own filtering pipeline, you might be better off with vtkImageViewer (or<br>a home-brewed analogon involving vtkActor2D/vtkImageMapper).<br><br>
If, on the other hand, you'd rather stick with vtkImageViewer2 but want<br>to have more control over the transform induced by camera parameters,<br>you might want to have a closer look at what vtkCamera and<br>vtkRenderer::ResetCamera() do. I'd say there is a way to set up the
<br>camera such that the results mimic vtkImageViewer (starting with<br>ParallelProjectionOn()), and calls to vtkRenderer::ResetCamera() can be<br>observed and acted upon by registering for the ResetCameraEvent -- but<br>
frankly, I'm not sure if it is worth the effort.<br><br><br>HTH, and apologies if I shared too much :-)<br><br>Obada<br><br></blockquote></div><br>