<div class="gmail_quote">On Wed, Mar 10, 2010 at 6:12 PM, Daniel Soares <span dir="ltr"><<a href="http://adaptchart.info">adaptchart.info</a>@<a href="http://gmail.com">gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I suppose you are saying that I use the following pipeline:<div><br></div><div>vtkSphereSource -> vtkVoxelModeller -> vtkDelaunay3D</div><div><br></div><div>The problem is that the input of vtkDelaunay3D is a vtkPointSet and the output of vtkVoxelModeller is a vtkImageData. How could I convert a vtkImageData to a vtkPointSet?</div>
<div><br></div><div>Anyway, it looks like the solution involves vtkMarchingCubes, as it's input is a vtkImageData. The problem is that vtkMarchingCubes is not displaying any result when used in my source code.</div><div>
<br></div><div>Any ideas?</div><div><br></div><div>Daniel Soares<br></div><div><br></div></blockquote><div class="gmail_quote"><br></div>To convert an ImageData to a PointSet, I don't think there is a better way than to do:</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">vtkPolyData* pd = vtkPolyData::New();</div><div class="gmail_quote">for(unsigned int i = 0; i < image->GetNumberOfPoints(); i++</div><div class="gmail_quote">
{</div><div class="gmail_quote"> double p[3];</div><div class="gmail_quote"> image->GetPoint(i, p);</div><div class="gmail_quote"> pd->InsertNextPoint(p);</div><div class="gmail_quote">}</div><div class="gmail_quote">
<br></div><div class="gmail_quote">As for why marching cubes doesn't display anything - maybe you can make the simplest example that will compile - make a sphere source, convert it to an ImageData, then run MarchingCubes. Post this compilable code to the list and we'll check it out.</div>
<div class="gmail_quote"><br clear="all">Thanks,<br><br>David</div>