[vtkusers] vtkImageThreshold and vtkContourFilter Resolution
Bill Lorensen
bill.lorensen at gmail.com
Thu Jul 29 08:10:35 EDT 2010
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.
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'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.
This example illustrate DiscreteMarchingCubes:
http://vtk.org/Wiki/VTK/Examples/Medical/GenerateModelsFromLabels
Bill
On Wed, Jul 28, 2010 at 10:05 AM, Paulo Henrique Junqueira Amorim <
paulojamorim at gmail.com> wrote:
> Hi,
>
> I'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).
>
> *Part of the code vtkImageThreshold and vtkContourFilter*
>
> t = vtk.vtkImageThreshold()
> t.SetInput(reader.GetOutput())
> t.ThresholdBetween(226,3021)
> t.SetOutValue(-1024)
> t.Update()
>
> contour = vtk.vtkContourFilter()
> contour.SetInput(t.GetOutput())
> contour.SetValue(0, 226) # Initial threshold
> contour.SetValue(1, 3021) # final threshold
> contour.ComputeScalarsOn()
> contour.ComputeGradientsOn()
>
> [image: vtkImageThreshold.PNG]
>
> *
>
>
>
> Part of the code only vtkContourFilter*
>
> contour = vtk.vtkContourFilter()
> contour.SetInput(reader.GetOutput())
> contour.SetValue(0, 226) # Initial threshold
> contour.SetValue(1, 3021) # final threshold
> contour.ComputeScalarsOn()
> contour.ComputeGradientsOn()
>
>
> [image: vtkContourFilter.PNG]
>
>
>
> Is it possible to use the vtkImageThreshold and vtkContourFilter but the
> end result be equal to use only vtkContourFilter to generate polydata ??
>
>
>
> Regards,
> Paulo Amorim
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100729/d8758527/attachment.htm>
More information about the vtkusers
mailing list