Hi Yang,<br><br>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<br>- either use a vtkCutter after the vtkContourFilter, <br>
vtkImporter2 -> vtkContourFilter -> vtkCutter <br>- or apply vtkContourFilter on an extracted slice of your input volume (eg. vtkExtractVOI).<br>vtkImporter2 -> vtkExtractVOI ->vtkContourFilter<br><br>(assumption made that vtkImporter2 is a sort of reader that imports your binary volume)<br>
<br>I don't know which method is the most efficient.<br><br>HTH,<br>Jerome<br><br><div class="gmail_quote">2011/2/24 Xiaopeng Yang <span dir="ltr"><<a href="mailto:yxp233@postech.ac.kr">yxp233@postech.ac.kr</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div link="blue" vlink="purple" lang="EN-US"><div><p class="MsoNormal">Hello VTK users,</p><p class="MsoNormal">
</p><p class="MsoNormal">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?</p>
<p class="MsoNormal"> </p><p class="MsoNormal">The code for generating contours:</p><p class="MsoNormal"> </p><p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New";">vtkContourFilter * contour = vtkContourFilter::New();</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New";">contour->SetInput( vtkImporter2->GetOutput() );</span></p><p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New";">contour->SetValue(0, 128); // edges of a binary image with values 0,255</span></p>
<p class="MsoNormal"> </p><p class="MsoNormal"><img src="cid:image003.jpg@01CBD40D.6D766490" height="264" width="253"></p><p class="MsoNormal"> </p><p class="MsoNormal">Thanks a lot,</p><p class="MsoNormal">Yang</p></div>
</div><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>