ContourFIlter does sub voxel interpolation. ThresholdFIiter makes a binary decision about whether a voxel is inside or outside the surface. Running ContourFilter on a Thresholded image defeats the purpose of the sub voxel interpolation.<br>
<br>If you have a more complex segmentation algorithm where you are assigning integral labels for a number of different classes, then you should run DiscreteMarchingCubes, since you can&#39;t interpolate between arbitrary integral labels. But you will not get a smooth isosurface. Depending on your application, you may need to smooth the polydata.<br>
<br>This example illustrate DiscreteMarchingCubes:<br><a href="http://vtk.org/Wiki/VTK/Examples/Medical/GenerateModelsFromLabels">http://vtk.org/Wiki/VTK/Examples/Medical/GenerateModelsFromLabels</a><br><br>Bill<br><br><div class="gmail_quote">
On Wed, Jul 28, 2010 at 10:05 AM, Paulo Henrique Junqueira Amorim <span dir="ltr">&lt;<a href="mailto:paulojamorim@gmail.com">paulojamorim@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br><br>I&#39;m using vtkImageThreshold to segment an image and to generate vtkContourFilter to generate the vtkPolyData, but the resolution of vtkPolyData not getting good by comparison when it is used only the vtkContourFilter to generate vtkPolyData (attached screens).<br>


<br><b>Part of the code vtkImageThreshold and vtkContourFilter</b><br><br>t = vtk.vtkImageThreshold()<br>t.SetInput(reader.GetOutput())<br>t.ThresholdBetween(226,3021)<br>t.SetOutValue(-1024)<br>t.Update()<br><br>contour = vtk.vtkContourFilter()<br>


contour.SetInput(t.GetOutput())<br>contour.SetValue(0, 226) # Initial threshold<br>contour.SetValue(1, 3021) # final threshold<br>contour.ComputeScalarsOn()<br>contour.ComputeGradientsOn()<br><br><img src="" title="vtkImageThreshold.PNG" alt="vtkImageThreshold.PNG"><br>


<br><b><br><br><br><br>Part of the code only vtkContourFilter</b><br><br>contour = vtk.vtkContourFilter()<br>contour.SetInput(reader.GetOutput())<br>contour.SetValue(0, 226) # Initial threshold<br>contour.SetValue(1, 3021) # final threshold<br>


contour.ComputeScalarsOn()<br>contour.ComputeGradientsOn()<br><br><br><img src="" title="vtkContourFilter.PNG" alt="vtkContourFilter.PNG"><br><br><br><br>Is it possible to use the vtkImageThreshold and vtkContourFilter but the end result be equal to use only vtkContourFilter to generate polydata ??<br>


<br><br><br>Regards,<br><font color="#888888">Paulo Amorim<br><br><br><br>
</font><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 <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></blockquote></div><br>