<DIV>Hi again,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Ok, my problem is maybe due to something else. And I hope someone could tell me what I'm really missing in all my procedure. </DIV>
<DIV>&nbsp;</DIV>
<DIV>Actually, I'm using <STRONG>ImageSliceViewer class</STRONG> to display&nbsp;a 3D image made of 2D slices got at different times (my 3rd dimension is the time and not Z coordinates). To select a 2D slice at one time, I use the <STRONG>SelectSlice</STRONG> method of ImageSliceViewer class. Here is a part of my code:</DIV>
<DIV>&nbsp;</DIV>
<DIV>void SelectSlice( int slice )<BR>{<BR>&nbsp; if ( ! m_Actor-&gt;GetInput() ) return;&nbsp; //no image is loaded yet</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;int MinMaxSlice[6];<BR>&nbsp; <STRONG>m_Actor-&gt;GetInput()-&gt;GetExtent( MinMaxSlice</STRONG> );</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;if ((slice&gt;=MinMaxSlice[4]) &amp;&amp; (slice&lt;=MinMaxSlice[5]))<BR>&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MinMaxSlice[4] = MinMaxSlice[5] = slice;<BR>&nbsp;&nbsp; }<BR>&nbsp;&nbsp; else //here is the problem because I'm falling in this case<BR>&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; CString s;<BR>&nbsp;&nbsp;&nbsp; s.Format("extent: %d %d %d %d %d %d, slice=%d\n",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MinMaxSlice[0],MinMaxSlice[1],MinMaxSlice[2],<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MinMaxSlice[3],MinMaxSlice[4],MinMaxSlice[5],<BR>&nbsp;&nbsp;&nbsp;&nbsp; slice);<BR>&nbsp;&nbsp;&nbsp; AfxMessageBox(s);<BR>&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;</DIV>
<DIV><STRONG>m_Actor-&gt;SetDisplayExtent(MinMaxSlice);</STRONG><BR>}</DIV>
<DIV>&nbsp;</DIV>
<DIV>My 3D image is of dimensions <STRONG>1552*128*167</STRONG>.</DIV>
<DIV>The first slice choosen to display is the first frame. However, <STRONG>when I'm triing to change the slice</STRONG> to display, <STRONG>always the first slice is displayed</STRONG>. That'why I check the value of m_Actor-&gt;GetInput()</DIV>
<DIV>-&gt;GetExtent( MinMaxSlice ); </DIV>
<DIV>&nbsp;</DIV>
<DIV>Here is the result: 0 1551 0 127 <STRONG>0 0</STRONG>. !!!!!!!!!!!!!!!!!!!</DIV>
<DIV>&nbsp;</DIV>
<DIV>So it seems that <STRONG>m_Actor-&gt;SetDisplayExtent(MinMaxSlice) change the extent of my m_Actor-&gt;GetInput() definitivly.</STRONG></DIV>
<DIV>&nbsp;</DIV>
<DIV>When I'm calling <STRONG>Render</STRONG>(), the input shouldn't call again, so that m_Actor-&gt;GetInput()-&gt;GetExtent() will always return me 0 1551 0 127 0 167 ?</DIV>
<DIV>&nbsp;</DIV>
<DIV><STRONG>Maybe there's really something wrong when I'm calling Render()</STRONG></DIV>
<DIV>&nbsp;</DIV>
<DIV>Please help</DIV>
<DIV>Isa<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">Try this before you call a Write()<BR><BR>renSrc-&gt;Modified();<BR><BR>hth<BR><BR>Goodwin<BR><BR><BR>"Renaud Isabelle" <RENAUISA@YAHOO.FR>wrote in message<BR>news:20050609203658.51819.qmail@web26105.mail.ukl.yahoo.com...<BR>Don't anyone have a solution? I really don't manage to solve this.<BR><BR>Why just this 2 lines added could change something?<BR><BR>Please<BR>Isa<BR><BR>Renaud Isabelle <RENAUISA@YAHOO.FR>a écrit :<BR>Hi,<BR><BR>I read your code example and I think this could help me because this seems<BR>to be right.<BR><BR>- When I display directly on screen, the image "essai.bmp" saved is the<BR>exact copy of what is rendered on screen: here is my code where everything<BR>is fine:<BR><BR>// render to memory with m_pRenderWindow as a vtkWin32OpenGLRenderWindow.<BR>m_pRenderWindow-&gt;Render();<BR><BR>vtkWindowToImageFilter* renSrc =
 vtkWindowToImageFilter::New();<BR>renSrc-&gt;SetInput(m_pRenderer);<BR>vtkBMPWriter* writer = vtkBMPWriter::New();<BR>writer-&gt;SetInput(renSrc-&gt;GetOutput());<BR>writer-&gt;SetFileName("essai.bmp");<BR>writer-&gt;Write();<BR><BR>- However, to avoid flickering on screen, I want to render off screen by<BR>double buffering. Here is the new code. Just is added the line<BR><BR>// render to memory with m_pRenderWindow as a vtkWin32OpenGLRenderWindow.<BR>int *size = m_pRenderWindow-&gt;GetSize();<BR>m_pRenderWindow-&gt;SetupMemoryRendering(size[0], size[1],<BR>GetDC() -&gt;GetSafeHdc());<BR>m_pRenderWindow-&gt;Render();<BR><BR>vtkWindowToImageFilter* renSrc = vtkWindowToImageFilter::New();<BR>renSrc-&gt;SetInput(m_pRenderer);<BR>vtkBMPWriter* writer = vtkBMPWriter::New();<BR>writer-&gt;SetInput(renSrc-&gt;GetOutput());<BR>writer-&gt;SetFileName("essai.bmp");<BR>writer-&gt;Write();<BR><BR>m_pRenderWindow-&gt;ResumeScreenRendering();<BR><BR>Problem: The image saved in essai.bmp is white.
 How could this be? I really<BR>don't understand.I check class vtkWin32OpenGLRenderWindow and I am stuck on<BR>this problem for 3 days.<BR><BR>Please help<BR>Isa<BR><BR><BR>Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger<BR>Téléchargez le ici ! _______________________________________________<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>Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger<BR>Téléchargez le ici !<BR><BR><BR><BR>_______________________________________________<BR>Insight-users mailing list<BR>Insight-users@itk.org<BR>http://www.itk.org/mailman/listinfo/insight-users<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><p>
                <hr size=1> 
<b><font color=#FF0000>Appel audio GRATUIT</font> partout dans le monde</b> avec le nouveau Yahoo! Messenger<br> 
<a href="http://us.rd.yahoo.com/messenger/mail_taglines/default/*http://fr.messenger.yahoo.com">Téléchargez le ici !</a>