<font size="2"><font face="verdana,sans-serif">You cannot save 3D image from QVTKWidget, because QVTKWidget is a 2D widget. To save 3D image you have to access vtkVolume which you added to the scene earlier. If however you have a polygonal scene which you want to voxelize, take a look here: <a href="http://www.vtk.org/Wiki/VTK/Examples/Broken/VoxelModeller">http://www.vtk.org/Wiki/VTK/Examples/Broken/VoxelModeller</a><br>

</font></font><br><div class="gmail_quote">2011/3/17 G G <span dir="ltr">&lt;<a href="mailto:greenlander1986@gmail.com">greenlander1986@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

I would like to save 3D image, but I do not know, where the problem can be. <font size="2"><font face="verdana,sans-serif">Discrepancy</font></font> might be my problem, but I do not know, how to solve this problem... <br>


I am newbie with VTK...<div><div></div><div class="h5"><br><br><div class="gmail_quote">2011/3/17 Dženan Zukić <span dir="ltr">&lt;<a href="mailto:dzenanz@gmail.com" target="_blank">dzenanz@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">


<font size="2"><font face="verdana,sans-serif">Are you trying to save 2D or 3D image? I believe your code is attempting to save rendered framebufferm which is a 2D image. MetaImage is usually used for 3D data, although it can save 2D data too. This 2D/3D discrepancy might be your problem.</font></font><div>




<font face="verdana, sans-serif"><br></font></div><div><font size="2"><font face="verdana,sans-serif"></font></font><font face="verdana, sans-serif">HTH<br></font><div><font size="2"><font face="verdana,sans-serif"></font></font><font face="verdana, sans-serif"><br>




</font><div class="gmail_quote"><div><div></div><div>On Thu, Mar 17, 2011 at 16:42, G G <span dir="ltr">&lt;<a href="mailto:greenlander1986@gmail.com" target="_blank">greenlander1986@gmail.com</a>&gt;</span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"><div><div></div><div>

Hi everyone,<br>I have some problem. I would like to save *.mhd file from <span><span><span style="font-family:courier new,monospace">QVTKWidget</span> component. I tried to seach on google, but any solution. <br>
<br><span style="font-family:courier new,monospace">        qVTK3-&gt;setAutomaticImageCacheEnabled(true);</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">        vtkSmartPointer&lt;vtkMetaImageWriter&gt; writer = vtkSmartPointer&lt;vtkMetaImageWriter&gt;::New();</span><br style="font-family:courier new,monospace">





<span style="font-family:courier new,monospace">        qVTK3-&gt;saveImageToCache();</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">        writer-&gt;SetInput(qVTK3-&gt;cachedImage());</span><br style="font-family:courier new,monospace">





<span style="font-family:courier new,monospace">        writer-&gt;SetFileName(fileName);</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">        std::string  str = fileName + &quot;.raw&quot;;</span><br style="font-family:courier new,monospace">





<span style="font-family:courier new,monospace">        writer-&gt;SetRAWFileName(str.c_str());</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">        writer-&gt;Write();<br>





<font face="arial,helvetica,sans-serif"><br><span style="font-family:courier new,monospace">qVTK3</span> is </font></span></span></span><span><span><span style="font-family:courier new,monospace">QVTKWidget</span></span></span><span><span><span style="font-family:courier new,monospace"><font face="arial,helvetica,sans-serif">.<br>





<br>This code save empty files... <br>I have to recomend, that I loaded *.mha or *.mhd files.<br>I will be very happy for each help...<br>Thanks a lot<br></font></span></span></span>
<br></div></div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div></div>
</blockquote></div><br>
</div></div></blockquote></div><br>