<html><div>I am trying to do off screen rendering of a volume. I am currently using windows xp, qt, and vtk, but will eventually be switching to linux. On screen rendering works fine. My volume displays normally and can be rotated and shifted without issue. In my final application I need to output three or four different png images of this volume from different angles (e.g. view from x axis, y axis, z axis, -z axis). When i switch my code to use off screen rendering the first rendered view is saved correctly to a PNG file. The rest of the views don't update so I end up with 3 copies of the first image.</div><div>&nbsp;</div><div>I have tried several different variations of this such as calling render from the interactor, calling render from the renderer itself, calling start and waitforcompletion on the window, calling modified on the data sets and filters. I seem to be missing something. Any help would be appreciated.</div><div>&nbsp;</div><div>Thanks,</div><div>&nbsp;</div><div>bwing</div><div>&nbsp;</div><div>My rendering code is as follows:</div><div>&nbsp;</div><div><span style="font-size: x-small;"><div>VTK_CREATE(vtkWin32OpenGLRenderWindow, window);</div><div>window-&gt;SetSize(1200, 600);</div><div>window-&gt;AddRenderer(ren);</div><div>window-&gt;OffScreenRenderingOn();</div><div>&nbsp;</div><div>VTK_CREATE(vtkWindowToImageFilter, imageFilter);</div><div>imageFilter-&gt;SetInput(window);</div><div>&nbsp;</div></span><span style="font-size: x-small;">&nbsp;<span style="font-size: x-small;">&nbsp;</span></span><div><span style="font-size: x-small;">&nbsp;</span></div><div><span style="font-size: x-small;"><div><span style="font-size: x-small;">ren-&gt;AddVolume(volume);</span></div></span></div><div><span style="font-size: x-small;">&nbsp;</span><span style="font-size: x-small;">&nbsp;</span></div><div><span style="font-size: x-small;">&nbsp;</span></div><div><span style="font-size: x-small;">&nbsp;</span></div><div><div><div><div><div><span style="font-size: x-small;"><div>window-&gt;Render();</div></span></div></div><span style="font-size: x-small;">&nbsp;</span></div><span style="font-size: x-small;">&nbsp;</span></div><span style="font-size: x-small;">&nbsp;</span></div><div><div><div><span style="font-size: x-small;"><div><div>&nbsp;</div><div><div><div><div><span style="font-size: x-small;">&nbsp;</span></div></div><span style="font-size: x-small;">&nbsp;</span></div><span style="font-size: x-small;">&nbsp;</span></div><span style="font-size: x-small;">&nbsp;</span></div><span style="font-size: x-small;">&nbsp;</span></span></div></div><span style="font-size: x-small;"><span style="font-size: x-small;">&nbsp;</span></span></div><div><span style="font-size: x-small;"><span style="font-size: x-small;"><div>writer-&gt;SetFileName((str +<span style="color: #a31515; font-size: x-small;"><span style="color: #a31515; font-size: x-small;">"yz.png"</span></span><span style="font-size: x-small;">).<span style="font-size: xx-small;">c_str());</span></span></div></span><div><div><div><span style="font-size: x-small;">writer-&gt;Write();</span></div></div><span style="font-size: x-small;">&nbsp;</span></div></span><span style="font-size: x-small;"></span></div><div><div><div>&nbsp;</div><div>window-&gt;SetSize(600, 1200);</div><div>camera-&gt;SetPosition(position[0], position[1], position[2] + 288);</div><div>window-&gt;Render();</div><div>&nbsp;</div><div><div><span style="font-size: x-small;">&nbsp;</span></div></div></div><span style="font-size: x-small;"><div>writer-&gt;SetFileName((str +<span style="color: #a31515; font-size: x-small;"><span style="color: #a31515; font-size: x-small;">"xy.png"</span></span><span style="font-size: x-small;"><span style="font-size: xx-small;">).c_str());</span></span> <div><div><div><div></div></div></div></div></div><span style="font-size: x-small;"><span style="font-size: x-small;"><font style="font-size: x-small;" size="2"><div>&nbsp;</div></font><span style="font-size: x-small;">writer-&gt;Write();</span></span></span></span><span style="font-size: x-small;"></span><div><span style="font-size: x-small;"></span></div><div><span style="font-size: x-small;"><span style="font-size: x-small;"><div>writer-&gt;SetFileName((str +<span style="color: #a31515; font-size: x-small;"><span style="color: #a31515; font-size: x-small;">"xz.png"</span></span><span style="font-size: x-small;"><span style="font-size: xx-small;">)</span>.<span style="font-size: xx-small;">c_str());</span></span></div></span></span><span style="font-size: x-small;"><div>writer-&gt;Write();</div></span></div></div><div><div>&nbsp;</div><div>window-&gt;SetSize(1200, 600);</div><div>camera-&gt;SetPosition(position[0], position[1] + 96, position[2]);</div><div>window-&gt;Render();</div><div>&nbsp;</div></div></div><div><span style="font-size: x-small;">std::string str = <span style="color: #a31515; font-size: x-small;"><span style="color: #a31515; font-size: x-small;">"D:\data\"</span></span><span style="font-size: x-small;">;</span></span></div><div><div>VTK_CREATE(vtkPNGWriter, writer);</div><span style="font-size: x-small;"><div><div><div><div><div><div><div><div><div><div><div><span style="font-size: x-small;"></span></div><div>writer-&gt;SetInput(imageFilter-&gt;GetOutput());</div></div></div><div></div></div></div></div></div></div></div></div></div></span></div></html>

<br><br><font SIZE="2" color="#000000">____________________________________________________________</font><br><a style="TEXT-DECORATION: none" href="http://thirdpartyoffers.juno.com/TGL3132/4d7fb720c74a61657a4st03vuc" target=_blank><font face="Arial"><font color="#004080" size="3"><b>Groupon&#8482 Official Site</b></font><br><font color="#000000" size="2">1 ridiculously huge coupon a day. Get 50-90% off your city&#39;s best!<br></a><a style="COLOR: #000000" href="http://thirdpartyoffers.juno.com/TGL3132/4d7fb720c74a61657a4st03vuc" target=_blank>Groupon.com</a></font></font>