I suppose you are saying that I use the following pipeline:<div><br></div><div>vtkSphereSource -&gt; vtkVoxelModeller -&gt; 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&#39;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><br><div class="gmail_quote">2010/3/10 KS Jothybasu <span dir="ltr">&lt;<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div dir="ltr">What about creating a mesh with vtkDelaunay3D?<br><br>Jothy<br><br><div class="gmail_quote"><div><div></div><div class="h5">On Wed, Mar 10, 2010 at 1:30 AM, Daniel Soares <span dir="ltr">&lt;<a href="http://adaptchart.info" target="_blank">adaptchart.info</a>@<a href="http://gmail.com" target="_blank">gmail.com</a>&gt;</span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex"><div><div></div><div class="h5">Hi!<div><br></div><div>I have a problem with voxelization in VTK. My purpose is to create a sphere using vtkSphereSource, then voxelize it using vtkVoxelModeller, then draw a surface that is similar to the original sphere. The only way I managed to draw a surface, was using vtkContourFilter. The problem is that some artifacts are produced, looking like holes in the voxelized sphere. </div>


<div>I saw at this site ( <a href="http://www.evl.uic.edu/aspale/cs526/final/3-5-2-0.htm" target="_blank">http://www.evl.uic.edu/aspale/cs526/final/3-5-2-0.htm</a> ), that the results with vtkMarchingCubes are much better than the ones with vtkContourFilter. So I tryied to use it, but I couldn&#39;t obtain any result at all (blank screen). The same happened when I used vtkDiscreteMarchingCubes and vtkImageMarchingCubes.</div>


<div><br></div><div>Does anyone have any idea why the marching cubes are not producing results or why the contour filter produces holes on the surface? Is there other way to achive what I want?</div><div><br></div><div>Here&#39;s the source code of my experiment:</div>


<div><br></div><div>//===============================================</div><div><br></div><div><div>vtkSphereSource* sphereModel = vtkSphereSource::New();</div><div>sphereModel-&gt;SetThetaResolution(10);</div><div>sphereModel-&gt;SetPhiResolution(10);</div>


<div><br></div><div>vtkVoxelModeller* voxeller = vtkVoxelModeller::New();</div><div>voxeller-&gt;SetSampleDimensions(17, 17, 17);</div><div>voxeller-&gt;SetModelBounds(-0.5, 0.5, -0.5, 0.5, -0.5, 0.5);</div><div>voxeller-&gt;SetInputConnection(sphereModel-&gt;GetOutputPort());</div>


<div>voxeller-&gt;Update();</div><div>vtkImageData* imageData = voxeller-&gt;GetOutput();</div><div>imageData-&gt;SetScalarTypeToFloat();</div><div><br></div><div>vtkLookupTable* lut = vtkLookupTable::New();</div><div>lut-&gt;SetNumberOfColors(3);</div>


<div>lut-&gt;SetTableRange(0, 1);</div><div>lut-&gt;SetScaleToLinear();</div><div>lut-&gt;Build();</div><div>lut-&gt;SetTableValue(0, 0, 0, 0, 1);</div><div>lut-&gt;SetTableValue(0.5, 1, 0, 0, 1);</div><div>lut-&gt;SetTableValue(1, 1, 1, 1, 1);</div>


<div><br></div><div>//vtkContourFilter* surface = vtkContourFilter::New();</div><div>vtkMarchingCubes* surface = vtkMarchingCubes::New();</div><div>surface-&gt;SetInput(imageData);</div><div>surface-&gt;ComputeScalarsOn();</div>


<div>surface-&gt;ComputeGradientsOn();</div><div>surface-&gt;ComputeNormalsOn();</div><div>surface-&gt;SetValue(0, 0.5);</div><div><br></div><div>vtkPolyDataMapper* voxelMapper = vtkPolyDataMapper::New();</div><div>voxelMapper-&gt;SetInputConnection(discrete-&gt;GetOutputPort());</div>


<div>voxelMapper-&gt;SetLookupTable(lut);</div><div>voxelMapper-&gt;SetScalarRange(0, lut-&gt;GetNumberOfColors());</div><div><br></div><div>vtkActor* voxelActor = vtkActor::New();</div><div>voxelActor-&gt;SetMapper(voxelMapper);</div>


<div><br></div><div>ren1-&gt;AddActor(voxelActor);</div><div><br></div><div>//==============================================</div></div><div><br></div><div>Thanks in advance.</div><div><br></div><font color="#888888"><div>

Daniel Soares</div>
</font><br></div></div><div class="im">_______________________________________________<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></div></blockquote></div><br></div>
</blockquote></div><br></div>