Frederic, Lynx,<br><br><br>Yes a two step process will bring your itkMeshes in to Blender:<br><br><br> A) Step 1: use the itkVTKPolyDataWriter.h class in <br> Insight/Code/Review to save your ITK Mesh as a vtkPolyData<br>
in a .vtk legacy file.<br><br> B) Step 2: use a small VTK program to read the .vtk files<br> and write it as an STL file<br><br><br><br>The code of (A) will look like:<br><br> typedef itk::VTKPolyDataWriter<MeshType> WriterType;<br>
WriterType::Pointer writer = WriterType::New();<br> writer->SetInput( mesh );<br> writer->SetFileName( "myFile.vtk" );<br> writer->Write();<br><br><br><br>The code of (B) will look like:<br><br> vtkPolyDataReader * reader = vtkPolyDataReader::New();<br>
reader->SetFileName( "myFile.vtk");<br> vtkSTLWriter * writer = vtkSTLWriter::New();<br> writer->SetFileName( "myFile.stl" );<br> writer->SetInput( reader->GetOutput() );<br> wirter->Write();<br>
<br><br>STL files can be read directly into Blender.<br><br><br> Regards,<br><br><br> Luis<br><br><br>--------------------------------------------------------------<br><div class="gmail_quote">On Thu, Aug 6, 2009 at 12:49 PM, Frederic Perez <span dir="ltr"><<a href="mailto:fredericpcx@gmail.com">fredericpcx@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello Lynx,<br><br><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
How can I get a nice render from blender of my watershed labeled 3D blobs?<br>
I found a python script that allows to import VTK poly data<br>
(VTKBlender.PolyDataMapperToBlender() at <a href="http://www.ualberta.ca/CNS/RESEARCH/Vis/VTKBlender/" target="_blank">http://www.ualberta.ca/CNS/RESEARCH/Vis/VTKBlender/</a>)<br>
and I found itk::BinaryMask3DMeshSource which seems to create a surface for a<br>
label. So I could iterate over all labels and create a mesh for each blob.<br>
Now I'm stuck on how to get these itk-meshes over vtk to blender?<br>
I couldn't find any examples in the itk or vtk docs. Has anyone done this<br>
before?</blockquote></div><div><br>I regret I know nothing about VTKBlender, but a few years ago I tackled a similar problem, and I took the time to write about it in my now possibly obsolete web pages. You might still consider the section "Importing VTK Isosurfaces" in <a href="http://imagingshots.com/ResearchInterest/onBlender.html" target="_blank">http://imagingshots.com/ResearchInterest/onBlender.html</a> (The "trick" was using STL files.) Hope it helps.<br>
<br>Good luck,<br><br>Frederic Perez<br><br></div></div><br>
<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<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 ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>