<DIV>Hi again,</DIV>
<DIV> </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> </DIV>
<DIV>Actually, I'm using <STRONG>ImageSliceViewer class</STRONG> to display 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> </DIV>
<DIV>void SelectSlice( int slice )<BR>{<BR> if ( ! m_Actor->GetInput() ) return; //no image is loaded yet</DIV>
<DIV> </DIV>
<DIV> int MinMaxSlice[6];<BR> <STRONG>m_Actor->GetInput()->GetExtent( MinMaxSlice</STRONG> );</DIV>
<DIV> </DIV>
<DIV> if ((slice>=MinMaxSlice[4]) && (slice<=MinMaxSlice[5]))<BR> {<BR> MinMaxSlice[4] = MinMaxSlice[5] = slice;<BR> }<BR> else //here is the problem because I'm falling in this case<BR> {<BR> CString s;<BR> s.Format("extent: %d %d %d %d %d %d, slice=%d\n",<BR> MinMaxSlice[0],MinMaxSlice[1],MinMaxSlice[2],<BR> MinMaxSlice[3],MinMaxSlice[4],MinMaxSlice[5],<BR> slice);<BR> AfxMessageBox(s);<BR> }<BR> </DIV>
<DIV><STRONG>m_Actor->SetDisplayExtent(MinMaxSlice);</STRONG><BR>}</DIV>
<DIV> </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->GetInput()</DIV>
<DIV>->GetExtent( MinMaxSlice ); </DIV>
<DIV> </DIV>
<DIV>Here is the result: 0 1551 0 127 <STRONG>0 0</STRONG>. !!!!!!!!!!!!!!!!!!!</DIV>
<DIV> </DIV>
<DIV>So it seems that <STRONG>m_Actor->SetDisplayExtent(MinMaxSlice) change the extent of my m_Actor->GetInput() definitivly.</STRONG></DIV>
<DIV> </DIV>
<DIV>When I'm calling <STRONG>Render</STRONG>(), the input shouldn't call again, so that m_Actor->GetInput()->GetExtent() will always return me 0 1551 0 127 0 167 ?</DIV>
<DIV> </DIV>
<DIV><STRONG>Maybe there's really something wrong when I'm calling Render()</STRONG></DIV>
<DIV> </DIV>
<DIV>Please help</DIV>
<DIV>Isa<BR><BR><B><I>Goodwin Lawlor <goodwin.lawlor@ucd.ie></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->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->Render();<BR><BR>vtkWindowToImageFilter* renSrc =
vtkWindowToImageFilter::New();<BR>renSrc->SetInput(m_pRenderer);<BR>vtkBMPWriter* writer = vtkBMPWriter::New();<BR>writer->SetInput(renSrc->GetOutput());<BR>writer->SetFileName("essai.bmp");<BR>writer->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->GetSize();<BR>m_pRenderWindow->SetupMemoryRendering(size[0], size[1],<BR>GetDC() ->GetSafeHdc());<BR>m_pRenderWindow->Render();<BR><BR>vtkWindowToImageFilter* renSrc = vtkWindowToImageFilter::New();<BR>renSrc->SetInput(m_pRenderer);<BR>vtkBMPWriter* writer = vtkBMPWriter::New();<BR>writer->SetInput(renSrc->GetOutput());<BR>writer->SetFileName("essai.bmp");<BR>writer->Write();<BR><BR>m_pRenderWindow->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>