<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:Batang;
panose-1:2 3 6 0 0 1 1 1 1 1;}
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Malgun Gothic";
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"\@Batang";
panose-1:2 3 6 0 0 1 1 1 1 1;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"\@Malgun Gothic";
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hello,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>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?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Best,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Yang<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span lang=ZH-CN style='font-size:10.0pt;font-family:宋体'>å‘件人</span></b><b><span style='font-size:10.0pt;font-family:宋体'>:</span></b><span style='font-size:10.0pt;font-family:宋体'> J<span lang=ZH-CN>é</span>rôme [mailto:jerome.velut@gmail.com] <br><b><span lang=ZH-CN>å‘é€æ—¶é—´</span>:</b> 2011</span><span lang=ZH-CN style='font-size:10.0pt;font-family:"Batang","serif"'>ë…„</span><span style='font-size:10.0pt;font-family:宋体'> 2</span><span lang=ZH-CN style='font-size:10.0pt;font-family:"Batang","serif"'>ì›”</span><span style='font-size:10.0pt;font-family:宋体'> 25</span><span lang=ZH-CN style='font-size:10.0pt;font-family:"Batang","serif"'>ì¼</span><span lang=ZH-CN style='font-size:10.0pt;font-family:宋体'> </span><span lang=ZH-CN style='font-size:10.0pt;font-family:"Batang","serif"'>금요ì¼</span><span lang=ZH-CN style='font-size:10.0pt;font-family:宋体'> </span><span lang=ZH-CN style='font-size:10.0pt;font-family:"Batang","serif"'>오후</span><span style='font-size:10.0pt;font-family:宋体'> 11:02<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<o:p></o:p></span></p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>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<o:p></o:p></p><div><p class=MsoNormal>2011/2/25 Xiaopeng Yang <<a href="mailto:yxp233@postech.ac.kr">yxp233@postech.ac.kr</a>><o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'>Hi Jerome,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'>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><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'>Could you tell me how to use vtkExtractVOI to make it, for example the parameters?</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'>Thanks,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'>Yang</span><o:p></o:p></p><div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;border-color:-moz-use-text-color -moz-use-text-color'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span lang=ZH-CN style='font-size:10.0pt;font-family:宋体'>å‘</span></b><b><span lang=ZH-CN style='font-size:10.0pt;font-family:"Batang","serif"'>件人</span></b><b><span style='font-size:10.0pt'>:</span></b><span style='font-size:10.0pt'> J</span><span lang=ZH-CN style='font-size:10.0pt;font-family:"Malgun Gothic","serif"'>é</span><span style='font-size:10.0pt'>rôme [mailto:<a href="mailto:jerome.velut@gmail.com" target="_blank">jerome.velut@gmail.com</a>] <br></span><b><span lang=ZH-CN style='font-size:10.0pt;font-family:宋体'>å‘</span></b><b><span lang=ZH-CN style='font-size:10.0pt;font-family:"Batang","serif"'>é€</span></b><b><span lang=ZH-CN style='font-size:10.0pt;font-family:宋体'>时间</span></b><b><span style='font-size:10.0pt'>:</span></b><span style='font-size:10.0pt'> 2011</span><span lang=ZH-CN style='font-size:10.0pt;font-family:"Batang","serif"'>ë…„</span><span style='font-size:10.0pt'> 2</span><span lang=ZH-CN style='font-size:10.0pt;font-family:"Batang","serif"'>ì›”</span><span style='font-size:10.0pt'> 24</span><span lang=ZH-CN style='font-size:10.0pt;font-family:"Batang","serif"'>ì¼</span><span lang=ZH-CN style='font-size:10.0pt'> </span><span lang=ZH-CN style='font-size:10.0pt;font-family:"Batang","serif"'>목요ì¼</span><span lang=ZH-CN style='font-size:10.0pt'> </span><span lang=ZH-CN style='font-size:10.0pt;font-family:"Batang","serif"'>오후</span><span style='font-size:10.0pt'> 5:07<br></span><b><span lang=ZH-CN style='font-size:10.0pt;font-family:"Malgun Gothic","serif"'>收件人</span></b><b><span style='font-size:10.0pt'>:</span></b><span style='font-size:10.0pt'> Xiaopeng Yang<br></span><b><span lang=ZH-CN style='font-size:10.0pt;font-family:"Malgun Gothic","serif"'>抄é€</span></b><b><span style='font-size:10.0pt'>:</span></b><span style='font-size:10.0pt'> vtk<br></span><b><span lang=ZH-CN style='font-size:10.0pt;font-family:"Malgun Gothic","serif"'>主</span></b><b><span lang=ZH-CN style='font-size:10.0pt;font-family:宋体'>题</span></b><b><span style='font-size:10.0pt'>:</span></b><span style='font-size:10.0pt'> Re: [vtkusers] Generate contours around the segmented regions</span><o:p></o:p></p></div><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'>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<o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>2011/2/24 Xiaopeng Yang <<a href="mailto:yxp233@postech.ac.kr" target="_blank">yxp233@postech.ac.kr</a>><o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Hello VTK users,<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>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?<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>The code for generating contours:<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Courier New"'>vtkContourFilter * contour = vtkContourFilter::New();</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Courier New"'>contour->SetInput( vtkImporter2->GetOutput() );</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:"Courier New"'>contour->SetValue(0, 128); // edges of a binary image with values 0,255</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><img border=0 width=253 height=264 id="_x0000_i1025" src="cid:image001.jpg@01CBD556.F43A5B40"><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Thanks a lot,<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Yang<o:p></o:p></p></div></div><p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'><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><o:p></o:p></p></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div></div></div></div></div><p class=MsoNormal><o:p> </o:p></p></div></body></html>