<DIV><BR><BR><B><I>Goodwin Lawlor &lt;goodwin.lawlor@ucd.ie&gt;</I></B> a écrit :
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<META content="MSHTML 6.00.2800.1491" name=GENERATOR>
<STYLE></STYLE>

<DIV><FONT face=Arial size=2>Hi Isabelle,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>A couple of things...</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>- you should use vtkImageViewer2... it uses vtkImageActor; or use the exact classes in the code below</FONT></DIV>
<DIV><STRONG>What do you mean by that: do I have to choose between using vtkImageViewer2 and implementing code like I did below?</STRONG></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>- you have to set the renWin to the same size as your image dimensions</FONT></DIV>
<DIV><STRONG>Actually, I would like to do the contrary: that is to say, to set the image dimensions to the same size as my renWin. Indeed, the image that I have to display is about 1552*128 (because of different pixel size according to directions), and I would like to display it in a frame of my MFC interface.</STRONG></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>- you have to set the camera's parallel scale to numRows*0.5</FONT></DIV>
<DIV><STRONG>Ok. I forgot to multipky by numRows the scale factor. This could explain my black image. Thanks</STRONG></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Goodwin</FONT></DIV>
<BLOCKQUOTE style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> <A title=renauisa@yahoo.fr href="mailto:renauisa@yahoo.fr">Renaud Isabelle</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=goodwin.lawlor@ucd.ie href="mailto:goodwin.lawlor@ucd.ie">Goodwin Lawlor</A> ; <A title=vtkusers@public.kitware.com href="mailto:vtkusers@public.kitware.com">vtkusers@public.kitware.com</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, May 25, 2005 4:29 PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [vtkusers] Re: stretch an image to fit in a window</DIV>
<DIV><BR></DIV>
<DIV>
<DIV>&nbsp;Hi,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Sorry to bother you again. </DIV>
<DIV>&nbsp;</DIV>
<DIV>I tried what you indicated me to scale my image into a window I passed.</DIV>
<DIV>&nbsp;</DIV>
<DIV><STRONG>I have no error at compilation. However, my image is not scaled at execution. </STRONG></DIV>
<DIV>&nbsp;</DIV>
<DIV>Is there any fault in this code:</DIV>
<DIV>&nbsp;</DIV>
<DIV>viewer-&gt;SetInput(reader-&gt;GetOutput());</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;<STRONG>vtkRenderer* ren1 = viewer-&gt;GetRenderer();<BR>&nbsp;ren1-&gt;GetActiveCamera()-&gt;ParallelProjectionOn();&nbsp;<BR>ren1-&gt;GetActiveCamera()-&gt;SetParallelScale(0.5);</STRONG></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;//display the image in the frame<BR>&nbsp;viewer-&gt;SetParentId(this-&gt;m_hWnd);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;//execute<BR>&nbsp;viewer-&gt;Render();&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>thanks in advance, </DIV>
<DIV>&nbsp;</DIV>
<DIV>Isabelle<BR><BR><BR><B><I>Goodwin Lawlor &lt;goodwin.lawlor@ucd.ie&gt;</I></B> a écrit:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Hi Isabelle,<BR><BR>Have a look at this example:<BR><BR>http://www.bioengineering-research.com/vtk/vhpreader.tcl<BR><BR>or<BR><BR>http://www.bioengineering-research.com/vtk/BackgroundImage.tcl<BR><BR><BR>here's the bit you need: (app is an image; numCol and numRow are the image<BR>dims)<BR><BR>vtkImageActor ia<BR>ia SetInput [app GetOutput]<BR>ia InterpolateOff<BR>vtkRenderer ren1<BR>ren1 AddActor ia<BR>ren1 SetBackground 1 1 1<BR>vtkRenderWindow renWin<BR>renWin AddRenderer ren1<BR>renWin SetSize [expr $numCol / 4] [expr $numRow / 4]<BR>vtkInteractorStyleImage istyle<BR>vtkRenderWindowInteractor iren<BR>iren SetRenderWindow renWin<BR>iren SetInteractorStyle istyle<BR>[ren1 GetActiveCamera] ParallelProjectionOn<BR>#fit the image to the render window<BR>[ren1 GetActiveCamera] SetParallelScale [expr $numRow / 2]<BR>renWin Render<BR><BR><BR>hth<BR><BR>Goodwin<BR><BR><BR>"Renaud !
 Isabelle" <RENAUISA@YAHOO.FR>wrote in message<BR>news:20050525115733.8984.qmail@web26108.mail.ukl.yahoo.com...<BR>Hi everyone,<BR><BR>I made a 2D image displayed in a window by using<BR>vtkImageViewer-&gt;SetParentId(this-&gt;m_hWnd). It works well, but my image is<BR>still displayed with its own dimensions. What I would like to do is find a<BR>way to display it in order to fit the dimensions of my window, something<BR>which could stretch my image.<BR><BR>Could someone suggest me something? I am not sure if it is a VTK or ITK<BR>problem.<BR><BR>By the way, what is the difference between vtkImageViewer and<BR>vtkImageViewer2?<BR><BR>Thanks in advance,<BR><BR>Isabelle<BR><BR><BR>Découvrez le nouveau Yahoo! Mail : 1 Go d'espace de stockage pour vos mails,<BR>photos et vidéos !<BR>Créez votre Yahoo! Mail<BR><BR><BR><BR>_______________________________________________<BR>This is the private VTK discussion list.<BR>Please keep messages on-topic. Check the FAQ
 at:<BR>http://www.vtk.org/Wiki/VTK_FAQ<BR>Follow this link to subscribe/unsubscribe:<BR>http://www.vtk.org/mailman/listinfo/vtkusers<BR><BR><BR><BR>_______________________________________________<BR>This is the private VTK discussion list. <BR>Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<BR>Follow this link to subscribe/unsubscribe:<BR>http://www.vtk.org/mailman/listinfo/vtkusers<BR></BLOCKQUOTE></DIV>
<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> </BLOCKQUOTE></BLOCKQUOTE></DIV><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>