[vtkusers] Generate contours around the segmented regions

Xiaopeng Yang yxp233 at postech.ac.kr
Fri Feb 25 11:46:15 EST 2011


Hello,

 

I got you and thanks very much for your help. So I need to write a loop if I want to get contours of all slices?

 

Best,

Yang

 

发件人: Jérôme [mailto:jerome.velut at gmail.com] 
发送时间: 2011년 2월 25일 금요일 오후 11:02
收件人: Xiaopeng Yang
抄送: vtk
主题: Re: [vtkusers] Generate contours around the segmented regions

 

Hi,

If you apply vtkExtractVOI to your binary volume, then you can extract one slice of the volume. If you apply vtkContourFilter to this slice (thus the output of vtkExtractVOI), then you will have 2D polygonal contours from the 2D binary image. When you change the extracted slice and update the whole pipeline, it will also update the traced contour.

Sorry if I am not clear enough, but I really hope it helps !
Jérôme

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

Hi Jerome,

 

Thanks very much. I prefer to use vtkExtractVOI. However, as far as I know, it just extract one slice from the volume. What I need is to generate 2D contour lines on each slice. I checked my results and found that the visualization not only includes 2D contour lines but also 3D surface. While I just need to show 2D contour lines, not 3D surface.

 

Could you tell me how to use vtkExtractVOI to make it, for example the parameters?

 

Thanks,

Yang

发件人: Jérôme [mailto:jerome.velut at gmail.com] 
发送时间: 2011년 2월 24일 목요일 오후 5:07
收件人: Xiaopeng Yang
抄送: vtk
主题: Re: [vtkusers] Generate contours around the segmented regions

 

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/20110226/525b5ec1/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/20110226/525b5ec1/attachment.obj>


More information about the vtkusers mailing list