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><br><div class="gmail_quote">2010/3/10 KS Jothybasu <span dir="ltr"><<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>></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"><<a href="http://adaptchart.info" target="_blank">adaptchart.info</a>@<a href="http://gmail.com" target="_blank">gmail.com</a>></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'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'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->SetThetaResolution(10);</div><div>sphereModel->SetPhiResolution(10);</div>
<div><br></div><div>vtkVoxelModeller* voxeller = vtkVoxelModeller::New();</div><div>voxeller->SetSampleDimensions(17, 17, 17);</div><div>voxeller->SetModelBounds(-0.5, 0.5, -0.5, 0.5, -0.5, 0.5);</div><div>voxeller->SetInputConnection(sphereModel->GetOutputPort());</div>
<div>voxeller->Update();</div><div>vtkImageData* imageData = voxeller->GetOutput();</div><div>imageData->SetScalarTypeToFloat();</div><div><br></div><div>vtkLookupTable* lut = vtkLookupTable::New();</div><div>lut->SetNumberOfColors(3);</div>
<div>lut->SetTableRange(0, 1);</div><div>lut->SetScaleToLinear();</div><div>lut->Build();</div><div>lut->SetTableValue(0, 0, 0, 0, 1);</div><div>lut->SetTableValue(0.5, 1, 0, 0, 1);</div><div>lut->SetTableValue(1, 1, 1, 1, 1);</div>
<div><br></div><div>//vtkContourFilter* surface = vtkContourFilter::New();</div><div>vtkMarchingCubes* surface = vtkMarchingCubes::New();</div><div>surface->SetInput(imageData);</div><div>surface->ComputeScalarsOn();</div>
<div>surface->ComputeGradientsOn();</div><div>surface->ComputeNormalsOn();</div><div>surface->SetValue(0, 0.5);</div><div><br></div><div>vtkPolyDataMapper* voxelMapper = vtkPolyDataMapper::New();</div><div>voxelMapper->SetInputConnection(discrete->GetOutputPort());</div>
<div>voxelMapper->SetLookupTable(lut);</div><div>voxelMapper->SetScalarRange(0, lut->GetNumberOfColors());</div><div><br></div><div>vtkActor* voxelActor = vtkActor::New();</div><div>voxelActor->SetMapper(voxelMapper);</div>
<div><br></div><div>ren1->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>