<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>Hi all vtk users.</DIV>
<DIV>I'm always waiting for your help to tell me how to extract the surface of a volume.</DIV>
<DIV>I post here the code i use to extract the surface of my volume. When i run it, i have some parts of the skull which are colored and not the whole surface. </DIV>
<DIV>Please, can you tell me what to modify in the code?</DIV>
<DIV>Thank you</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>vtkVolume16Reader *v16 = vtkVolume16Reader::New();<BR>v16-&gt;SetDataDimensions(256,256);<BR>v16-&gt;SetFilePrefix("C:/test");<BR>v16-&gt;SetImageRange(0,160); <BR>v16-&gt;SetDataByteOrderToLittleEndian();<BR>v16-&gt;SetDataSpacing(2,1,2);<BR>&nbsp;<BR>// The isosurface<BR>vtkMergePoints *locator = vtkMergePoints::New();<BR>locator-&gt;SetDivisions(32,32,46);<BR>locator-&gt;SetNumberOfPointsPerBucket(2);<BR>locator-&gt;AutomaticOff();<BR>&nbsp;<BR>vtkMarchingCubes *iso = vtkMarchingCubes::New();<BR>iso-&gt;SetInput(v16-&gt;GetOutput());<BR>iso-&gt;SetValue(1,1000);<BR>iso-&gt;ComputeGradientsOn();<BR>iso-&gt;ComputeScalarsOn();<BR>iso-&gt;SetLocator(locator);<BR>&nbsp;<BR>// Smooth the surface<BR>vtkSmoothPolyDataFilter *smooth =
 vtkSmoothPolyDataFilter::New();<BR>smooth-&gt;SetInput(iso-&gt;GetOutput());<BR>smooth-&gt;SetNumberOfIterations(100);<BR>smooth-&gt;BoundarySmoothingOn();<BR>smooth-&gt;SetFeatureAngle(120);<BR>smooth-&gt;SetEdgeAngle(90);<BR>smooth-&gt;SetRelaxationFactor(1);<BR>&nbsp;<BR>// Display<BR>vtkVectorNorm *gradient = vtkVectorNorm::New();<BR>gradient-&gt;SetInput(smooth-&gt;GetOutput());<BR>&nbsp;<BR>vtkDataSetMapper *isoMapper = vtkDataSetMapper::New();<BR>isoMapper-&gt;SetInput(gradient-&gt;GetOutput());<BR>isoMapper-&gt;ScalarVisibilityOn();<BR>isoMapper-&gt;SetScalarRange(0,1200);<BR>isoMapper-&gt;ImmediateModeRenderingOn();<BR></DIV></td></tr></table><br>