<DIV>Hi,</DIV>
<DIV>&nbsp;</DIV>
<DIV>No, I'm not. I'm want to display a 2D image. So I presume that I don't have to use <STRONG>SetZSlice</STRONG>(). If so, why should I? </DIV>
<DIV>&nbsp;</DIV>
<DIV>Here is my code:</DIV>
<DIV>&nbsp;</DIV>
<DIV><STRONG>viewer-&gt;SetInput(image2D);</STRONG></DIV>
<DIV><STRONG></STRONG>&nbsp;</DIV>
<DIV><STRONG>&nbsp;//display the image in the frame<BR>&nbsp;viewer-&gt;SetParentId(this-&gt;m_hWnd);</STRONG></DIV>
<DIV><STRONG></STRONG>&nbsp;</DIV>
<DIV><STRONG>&nbsp;//to fit the image to the render window, <BR>&nbsp;//parallel camera = parallel projection is used&nbsp;<BR>&nbsp;vtkRenderer* ren1 = viewer-&gt;GetRenderer(); <BR>&nbsp;ren1-&gt;GetActiveCamera()-&gt;ParallelProjectionOn();&nbsp;<BR>&nbsp;&nbsp;&nbsp; ren1-&gt;GetActiveCamera()-&gt;SetParallelScale(0.5);</STRONG></DIV>
<DIV><STRONG></STRONG>&nbsp;</DIV>
<DIV><STRONG>&nbsp;//execute<BR>&nbsp;viewer-&gt;Render();&nbsp;</STRONG></DIV>
<DIV>&nbsp;</DIV>
<DIV>Isabelle</DIV>
<DIV><BR><B><I>Mathieu Malaterre &lt;mathieu.malaterre@kitware.com&gt;</I></B> a écrit :</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Salut Isabelle,<BR><BR>Are you using vtkImageViewer2 and:<BR><BR>viewer-&gt;SetZSlice( slice );<BR><BR>If so make sure you are resetting the camera clipping range:<BR><BR>viewer-&gt;GetRenderer()-&gt;ResetCameraClippingRange();<BR><BR><BR>Other than that vtkImageViewer and vtkImageViewer2 works exactly the <BR>same way.<BR><BR>HTH<BR>Mathieu<BR><BR>Renaud Isabelle wrote:<BR>&gt; Hi again,<BR>&gt; <BR>&gt; I'm still locked with my problem of stretch my image in a window I passed.<BR>&gt; <BR>&gt; It seems that *vtkImageViewer* doesn't hav any camera instantiated. <BR>&gt; That's why the code:<BR>&gt; <BR>&gt; *vtkRenderer* ren1 = viewer-&gt;GetRenderer();<BR>&gt; ren1-&gt;GetActiveCamera()-&gt;ParallelProjectionOn(); <BR>&gt; ren1-&gt;GetActiveCamera()-&gt;SetParallelScale(2.0);*<BR>&gt; ** <BR>&gt; * //execute<BR>&gt; viewer-&gt;Render();* <BR>&gt; <BR>&gt; doesn't produce any scaling
 of the image.<BR>&gt; <BR>&gt; Then, I tried *vtkImageViewer2 *that seems to have a camera. But this <BR>&gt; class seems to hav another problem since the same code doesn't display <BR>&gt; my image at all but a black image instead.<BR>&gt; <BR>&gt; What is the solution? Do I hav to implement my own vtkImageViewer class <BR>&gt; and incorporate a camera? Or does it already exist a solution to use <BR>&gt; vtkImageViewer2?<BR>&gt; <BR>&gt; I'm confused and really don't know what to do. Please help me<BR>&gt; <BR>&gt; Isabelle<BR>&gt; <BR>&gt; <BR>&gt; */Renaud Isabelle <RENAUISA@YAHOO.FR>/* a écrit :<BR>&gt; <BR>&gt; Hi,<BR>&gt; <BR>&gt; Sorry to bother you again.<BR>&gt; <BR>&gt; I tried what you indicated me to scale my image into a window I passed.<BR>&gt; <BR>&gt; *I have no error at compilation. However, my image is not scaled at<BR>&gt; execution. *<BR>&gt; <BR>&gt; Is there any fault in this code:<BR>&gt; <BR>&gt; viewer-&gt;SetInput(reader-&gt;GetOutput());<BR>&gt; <BR>&gt;
 *vtkRenderer* ren1 = viewer-&gt;GetRenderer();<BR>&gt; ren1-&gt;GetActiveCamera()-&gt;ParallelProjectionOn(); <BR>&gt; ren1-&gt;GetActiveCamera()-&gt;SetParallelScale(0.5);*<BR>&gt; <BR>&gt; //display the image in the frame<BR>&gt; viewer-&gt;SetParentId(this-&gt;m_hWnd);<BR>&gt; <BR>&gt; //execute<BR>&gt; viewer-&gt;Render(); <BR>&gt; <BR>&gt; thanks in advance,<BR>&gt; <BR>&gt; Isabelle<BR>&gt; <BR>&gt; <BR>&gt; */Goodwin Lawlor <GOODWIN.LAWLOR@UCD.IE>/* a écrit:<BR>&gt; <BR>&gt; Hi Isabelle,<BR>&gt; <BR>&gt; Have a look at this example:<BR>&gt; <BR>&gt; http://www.bioengineering-research.com/vtk/vhpreader.tcl<BR>&gt; <BR>&gt; or<BR>&gt; <BR>&gt; http://www.bioengineering-research.com/vtk/BackgroundImage.tcl<BR>&gt; <BR>&gt; <BR>&gt; here's the bit you need: (app is an image; numCol and numRow are<BR>&gt; the image<BR>&gt; dims)<BR>&gt; <BR>&gt; vtkImageActor ia<BR>&gt; ia SetInput [app GetOutput]<BR>&gt; ia InterpolateOff<BR>&gt; vtkRenderer ren1<BR>&gt; ren1 AddActor ia<BR>&gt;
 ren1 SetBackground 1 1 1<BR>&gt; vtkRenderWindow renWin<BR>&gt; renWin AddRenderer ren1<BR>&gt; renWin SetSize [expr $numCol / 4] [expr $numRow / 4]<BR>&gt; vtkInteractorStyleImage istyle<BR>&gt; vtkRenderWindowInteractor iren<BR>&gt; iren SetRenderWindow renWin<BR>&gt; iren SetInteractorStyle istyle<BR>&gt; [ren1 GetActiveCamera] ParallelProjectionOn<BR>&gt; #fit the image to the render window<BR>&gt; [ren1 GetActiveCamera] SetParallelScale [expr $numRow / 2]<BR>&gt; renWin Render<BR>&gt; <BR>&gt; <BR>&gt; hth<BR>&gt; <BR>&gt; Goodwin<BR>&gt; <BR>&gt; <BR>&gt; "Renaud ! Isabelle" wrote in message<BR>&gt; news:20050525115733.8984.qmail@web26108.mail.ukl.yahoo.com...<BR>&gt; Hi everyone,<BR>&gt; <BR>&gt; I made a 2D image displayed in a window by using<BR>&gt; vtkImageViewer-&gt;SetParentId(this-&gt;m_hWnd). It works well, but my<BR>&gt; image is<BR>&gt; still displayed with its own dimensions. What I would like to do<BR>&gt; is find a<BR>&gt; way to display it in order to fit the
 dimensions of my window,<BR>&gt; something<BR>&gt; which could stretch my image.<BR>&gt; <BR>&gt; Could someone suggest me something? I am not sure if it is a VTK<BR>&gt; or ITK<BR>&gt; problem.<BR>&gt; <BR>&gt; By the way, what is the difference between vtkImageViewer and<BR>&gt; vtkImageViewer2?<BR>&gt; <BR>&gt; Thanks in advance,<BR>&gt; <BR>&gt; Isabelle<BR>&gt; <BR>&gt; <BR>&gt; Découvrez le nouveau Yahoo! Mail : 1 Go d'espace de stockage<BR>&gt; pour vos mails,<BR>&gt; photos et vidéos !<BR>&gt; Créez votre Yahoo! Mail<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; _______________________________________________<BR>&gt; This is the private VTK discussion list.<BR>&gt; Please keep messages on-topic. Check the FAQ at:<BR>&gt; http://www.vtk.org/Wiki/VTK_FAQ<BR>&gt; Follow this link to subscribe/unsubscribe:<BR>&gt; http://www.vtk.org/mailman/listinfo/vtkusers<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; _______________________________________________<BR>&gt; This is the private VTK discussion
 list.<BR>&gt; Please keep messages on-topic. Check the FAQ at:<BR>&gt; http://www.vtk.org/Wiki/VTK_FAQ<BR>&gt; Follow this link to subscribe/unsubscribe:<BR>&gt; http://www.vtk.org/mailman/listinfo/vtkusers<BR>&gt; <BR>&gt; ------------------------------------------------------------------------<BR>&gt; Découvrez le nouveau Yahoo! Mail : 1 Go d'espace de stockage pour<BR>&gt; vos mails, photos et vidéos !<BR>&gt; Créez votre Yahoo! Mail<BR>&gt; <HTTP: creer28.html mail fr.promotions.yahoo.com *http: default taglines_1go splash mail_campaigns mail_fr us.rd.yahoo.com><BR>&gt; _______________________________________________<BR>&gt; This is the private VTK discussion list.<BR>&gt; Please keep messages on-topic. Check the FAQ at:<BR>&gt; http://www.vtk.org/Wiki/VTK_FAQ<BR>&gt; Follow this link to subscribe/unsubscribe:<BR>&gt; http://www.vtk.org/mailman/listinfo/vtkusers<BR>&gt; <BR>&gt; ------------------------------------------------------------------------<BR>&gt; Découvrez le nouveau
 Yahoo! Mail : 1 Go d'espace de stockage pour vos <BR>&gt; mails, photos et vidéos !<BR>&gt; Créez votre Yahoo! Mail <BR>&gt; <HTTP: creer28.html mail fr.promotions.yahoo.com *http: default taglines_1go splash mail_campaigns mail_fr us.rd.yahoo.com><BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; ------------------------------------------------------------------------<BR>&gt; <BR>&gt; _______________________________________________<BR>&gt; This is the private VTK discussion list. <BR>&gt; Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<BR>&gt; Follow this link to subscribe/unsubscribe:<BR>&gt; http://www.vtk.org/mailman/listinfo/vtkusers<BR><BR></BLOCKQUOTE><p>
                <hr size=1> 
Découvrez le nouveau Yahoo! Mail : <font color="red">1 Go d'espace</font> de stockage pour vos mails, photos et vidéos !<br><a href="http://us.rd.yahoo.com/mail_fr/mail_campaigns/splash/taglines_1go/default/*http://fr.promotions.yahoo.com/mail/creer28.html" target="_blank">Créez votre Yahoo! Mail</a>