<DIV>Thanks, Luis, for your advice. I took a look at the example supplied in ImageSliceViewer. And I implement what is inside SetupCamera().</DIV>
<DIV> </DIV>
<DIV>However, where I am going really <STRONG>crazy</STRONG> :-D, is that <STRONG>all lines of code that I am implementing is not taken into account</STRONG>. The result is still the same. </DIV>
<DIV> </DIV>
<DIV>Here is what I did:</DIV>
<DIV> </DIV>
<DIV>//(vtkImageViewer*) viewer</DIV>
<DIV>imageInitiale = reader->GetOutput();</DIV>
<DIV>viewer->SetInput(imageInitiale);</DIV>
<DIV> </DIV>
<DIV> //display the image in the frame<BR> <STRONG>viewer->SetParentId(this->m_hWnd);</STRONG></DIV>
<DIV> </DIV>
<DIV> //to fit the image to the render window, <BR> float spacing[3] = {imageInitiale->GetSpacing()[0], <BR> imageInitiale->GetSpacing()[1],<BR> imageInitiale->GetSpacing()[2]};</DIV>
<DIV> double max = MAX(spacing[0]*width,spacing[1]*height);</DIV>
<DIV><BR> vtkCamera* camera = viewer->GetRenderer()->GetActiveCamera();<BR> viewer->GetRenderer()->ResetCamera();<BR> <STRONG>camera->ParallelProjectionOn();<BR> camera->SetParallelScale(max/2);</STRONG></DIV>
<DIV> </DIV>
<DIV> //execute<BR> viewer->Render();</DIV>
<DIV> </DIV>
<DIV>What`s wrong with that?</DIV>
<DIV> </DIV>
<DIV>Isabelle</DIV>
<DIV> <BR><BR><B><I>Luis Ibanez <luis.ibanez@kitware.com></I></B> a écrit:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><BR>Hi Isabelle,<BR><BR><BR>Thanks for letting us know that you were using<BR>VTK for visualization.<BR><BR>...You should have said that from the beginning :-)<BR><BR><BR><BR>Please look at the code in the file<BR><BR><BR>ImageSliceViewer.cxx<BR><BR><BR>in the directory<BR><BR>InsightApplications/<BR>LiverTumorSegmentation/<BR><BR><BR>http://www.itk.org/cgi-bin/viewcvs.cgi/LiverTumorSegmentation/ImageSliceViewer.cxx?rev=1.3&root=InsightApplications&view=log<BR><BR><BR>You will see in this class how to manage<BR>the scale of your image in the method<BR>SetupCamera(), in lines 118-185.<BR><BR><BR><BR>BTW, I'm assuming that you want to stretch the<BR>image *WITHOUT* changing its aspect ratio. You<BR>probably don't want to change the aspect ratio<BR>of a Medical Image.<BR><BR><BR>Note that *iff* your image has correctly specified<BR>its pixel size in X and Y. VTK will take this
pixel<BR>size into account at the moment of rendering the<BR>image.<BR><BR><BR><BR>Regards,<BR><BR><BR>Luis<BR><BR><BR><BR>------------------------<BR>Renaud Isabelle wrote:<BR>> Hi everybody,<BR>> <BR>> My job is to implement an MFC interface for medical image segmentation <BR>> purposes. Before, my lab was working on Matlab to display their data. <BR>> Default behavior of matlab is to display my image in parallel mode and <BR>> stretch the image to fill the best my window. It was a convenient way to <BR>> see our 1552*128 images. That is exactly what I want to reproduce in my <BR>> interface.<BR>> <BR>> So, what I am desperately trying to do is to stretch my image (different <BR>> scale factors in x and y) to fit my render window.<BR>> <BR>> viewer->GetRenderer()->GetActiveCamera()->*ParallelProjectionOn*() is <BR>> OK, but<BR>> viewer->GetRenderer()->GetActiveCamera()->*SetParallelScale*() scale <BR>> not stretch
my image.<BR>> There should be a way to stretch. <BR>> <BR>> Isabelle<BR>> <BR>> ------------------------------------------------------------------------<BR>> Découvrez le nouveau Yahoo! Mail : 1 Go d'espace de stockage pour vos <BR>> mails, photos et vidéos !<BR>> Créez votre Yahoo! Mail <BR>> <HTTP: creer28.html mail fr.promotions.yahoo.com *http: default taglines_1go splash mail_campaigns mail_fr us.rd.yahoo.com><BR>> <BR>> <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><BR><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>