<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:΢ÈíÑźÚ
}
--></style>
</head>
<body class='hmmessage'>
Hi, David<BR>Sorry, I can not comprehend the work mechanism&nbsp;of vtk. I modified my code as you mentioned in reply, but it doesn't work.&nbsp;<BR>My code is as fellows:<BR>&nbsp;<BR>&nbsp;vtkRenderer *aRenderer = vtkRenderer::New();<BR>&nbsp;vtkRenderWindow *renWin = vtkRenderWindow::New();<BR>&nbsp;renWin-&gt;AddRenderer(aRenderer);<BR>&nbsp;vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();<BR>&nbsp;iren-&gt;SetRenderWindow(renWin);<BR>&nbsp;<BR>&nbsp;vtkContourFilter *contours = vtkContourFilter::New();<BR>&nbsp;vtkPolyDataMapper *contmap = vtkPolyDataMapper::New();<BR>&nbsp;vtkActor *contact = vtkActor::New();<BR>&nbsp;<BR>&nbsp;vtkCamera *aCamera = vtkCamera::New();<BR>&nbsp;aCamera-&gt;ParallelProjectionOn();<BR>&nbsp;aRenderer-&gt;SetActiveCamera(aCamera);<BR>&nbsp;aRenderer-&gt;ResetCamera();<BR>&nbsp;aRenderer-&gt;SetBackground(0.725,0.725,1);<BR>&nbsp;renWin-&gt;SetSize(1024, 768);<BR>&nbsp;aRenderer-&gt;ResetCameraClippingRange ();<BR>&nbsp;iren-&gt;Initialize();<BR><BR>//&nbsp;loop <BR>for (int i=iFirstFrame; i&lt;iNumFrames; i++)<BR>{<BR>&nbsp; ......<BR>&nbsp; interpolate bmpimage into volumeimage;<BR>&nbsp; ......<BR>&nbsp; volumeimage-&gt;update();<BR>&nbsp;&nbsp;contours-&gt;SetInput(volumeimage);<BR>&nbsp;&nbsp;contours-&gt;SetValue(0,gval);<BR>&nbsp;&nbsp;contmap-&gt;SetInput(contours-&gt;GetOutput());<BR>&nbsp;&nbsp;contmap-&gt;SetScalarRange(100,220);<BR>&nbsp;&nbsp;contact-&gt;SetMapper(contmap);<BR>&nbsp;&nbsp;aRenderer-&gt;AddActor(contact);<BR>&nbsp;&nbsp;aRenderer-&gt;Render();<BR>&nbsp;&nbsp;iren-&gt;Render();<BR>}<BR>iren-&gt;Start();<BR>&nbsp;<BR>thank you.<BR><BR>&nbsp;<BR>
&gt; Date: Fri, 5 Nov 2010 07:48:09 -0400<BR>&gt; From: daviddoria@gmail.com<BR>&gt; To: luannauk@gmail.com<BR>&gt; CC: vtkusers@vtk.org<BR>&gt; Subject: Re: [vtkusers] vtk can render 3d image realtime?<BR>&gt; <BR>&gt; On Fri, Nov 5, 2010 at 6:33 AM, kuan luan &lt;luannauk@gmail.com&gt; wrote:<BR>&gt; &gt; Dear all,<BR>&gt; &gt; I am a vtk beginner. I am&nbsp;trying to reconstruct&nbsp;a 3d medical image from 2d<BR>&gt; &gt; images with spacial coordinates. I use vtk for reconstructing and surface<BR>&gt; &gt; rendering.<BR>&gt; &gt; now, I have a program for 3d reconstruction&nbsp;from 2d images offline.<BR>&gt; &gt; My method is<BR>&gt; &gt; &nbsp; acquire a new 2d image with spacial coordiante,<BR>&gt; &gt; &nbsp; interpolate it into 3d vtkimage.<BR>&gt; &gt; &nbsp; render the 3d vtkimage with new&nbsp;2d image added,<BR>&gt; &gt; &nbsp; a new vtkRenderWindow is created.<BR>&gt; &gt; all procedure run in a while loop.<BR>&gt; &gt;<BR>&gt; &gt; But, I want to implement it in realtime.<BR>&gt; &gt; My problem is I can not render 3d reconstructed image with vtk in&nbsp;realtime.<BR>&gt; &gt; How can the 3d vtkimage be rendered again in the same vtkRenderWindow<BR>&gt; &gt; without creating a new one?&nbsp; Is this possible using VTK?&nbsp; If so please tell<BR>&gt; &gt; me how to do it.<BR>&gt; &gt;<BR>&gt; &gt; I'm using VTK5.4 and Microsoft Visual C++ 2008.<BR>&gt; &gt; Any advice is appreciated ;)<BR>&gt; &gt; Thank you in advance.<BR>&gt; <BR>&gt; Sure, just create the vtkRenderWindow and vtkRenderer outside (before)<BR>&gt; the loop. Then inside the loop just add your new data to the renderer<BR>&gt; and call Render() on the renderer and renderWindow.<BR>&gt; <BR>&gt; David<BR>&gt; _______________________________________________<BR>&gt; Powered by www.kitware.com<BR>&gt; <BR>&gt; Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html<BR>&gt; <BR>&gt; Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<BR>&gt; <BR>&gt; Follow this link to subscribe/unsubscribe:<BR>&gt; http://www.vtk.org/mailman/listinfo/vtkusers<BR>                                               </body>
</html>