Hi,<br><br>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.<br>
<br>Sorry if I am not clear enough, but I really hope it helps !<br>Jérôme<br><br><div class="gmail_quote">2011/2/25 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"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Hi Jerome,</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">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.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Could you tell me how to use vtkExtractVOI to make it, for example the parameters?</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Thanks,</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Yang</span></p>
<div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; padding: 3pt 0in 0in;"><p class="MsoNormal"><b><span style="font-size: 10pt;" lang="ZH-CN">发件人</span></b><b><span style="font-size: 10pt;">:</span></b><span style="font-size: 10pt;"> J<span lang="ZH-CN">é</span>rôme [mailto:<a href="mailto:jerome.velut@gmail.com" target="_blank">jerome.velut@gmail.com</a>] <br>
<b><span lang="ZH-CN">发送时间</span>:</b> 2011</span><span style="font-size: 10pt; font-family: "Batang","serif";" lang="ZH-CN">년</span><span style="font-size: 10pt;"> 2</span><span style="font-size: 10pt; font-family: "Batang","serif";" lang="ZH-CN">월</span><span style="font-size: 10pt;"> 24</span><span style="font-size: 10pt; font-family: "Batang","serif";" lang="ZH-CN">일</span><span style="font-size: 10pt;" lang="ZH-CN"> </span><span style="font-size: 10pt; font-family: "Batang","serif";" lang="ZH-CN">목요일</span><span style="font-size: 10pt;" lang="ZH-CN"> </span><span style="font-size: 10pt; font-family: "Batang","serif";" lang="ZH-CN">오후</span><span style="font-size: 10pt;"> 5:07<br>
<b><span lang="ZH-CN">收件人</span>:</b> Xiaopeng Yang<br><b><span lang="ZH-CN">抄送</span>:</b> vtk<br><b><span lang="ZH-CN">主题</span>:</b> Re: [vtkusers] Generate contours around the segmented regions</span></p></div><div><div>
</div><div class="h5"><p class="MsoNormal"> </p><p class="MsoNormal" style="margin-bottom: 12pt;">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</p><div><p class="MsoNormal">2011/2/24 Xiaopeng Yang <<a href="mailto:yxp233@postech.ac.kr" target="_blank">yxp233@postech.ac.kr</a>></p>
<div><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:image001.jpg@01CBD4D1.83807B80" height="264" width="253" border="0"></p><p class="MsoNormal"> </p><p class="MsoNormal">Thanks a lot,</p><p class="MsoNormal">Yang</p>
</div></div><p class="MsoNormal" style="margin-bottom: 12pt;"><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></p>
</div><p class="MsoNormal"> </p></div></div></div></div></blockquote></div><br>