[vtkusers] Generate contours around the segmented regions

Jérôme jerome.velut at gmail.com
Thu Feb 24 03:06:54 EST 2011


Hi Yang,

Indeed, the vtkContourFilter is doing exactly what you are asking for : it
encloses the binary region inside a contour/surface. If you need to check
the segmentation result on each slice, you can
- either use a vtkCutter after the vtkContourFilter,
vtkImporter2 -> vtkContourFilter -> vtkCutter
- or apply vtkContourFilter on an extracted slice of your input volume (eg.
vtkExtractVOI).
vtkImporter2 -> vtkExtractVOI ->vtkContourFilter

(assumption made that vtkImporter2 is a sort of reader that imports your
binary volume)

I don't know which method is the most efficient.

HTH,
Jerome

2011/2/24 Xiaopeng Yang <yxp233 at postech.ac.kr>

> Hello VTK users,
>
>
>
> After segmentation, I would like to generate contours around the segmented
> regions. And then visualize the contours over the original images. However,
> The generated “contours” look like 3D surface, not 2D contours (see the
> following image). Do you guys know what’s going on?
>
>
>
> The code for generating contours:
>
>
>
> vtkContourFilter * contour = vtkContourFilter::New();
>
> contour->SetInput( vtkImporter2->GetOutput() );
>
> contour->SetValue(0, 128); // edges of a binary image with values 0,255
>
>
>
>
>
> Thanks a lot,
>
> Yang
>
> _______________________________________________
> 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/20110224/106c6885/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/octet-stream
Size: 7825 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110224/106c6885/attachment.obj>


More information about the vtkusers mailing list