<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">I have worked with the Canny edge detector in the ITK and the results were good.<div><br></div><div>The Affine transformation supports shearing but not inflation unless you can treat the</div><div><br></div><div>inflation as a linear scaling which means that if you need to inflate the contours&nbsp;</div><div><br></div><div>non-linearly this&nbsp;transformation function is probably not the way to do it. In that case&nbsp;</div><div><br></div><div>you can use the&nbsp;B-Spline deformable transformation (easier with a warping model&nbsp;</div><div><br></div><div>rather than setting&nbsp;the B-Spline&nbsp;coefficients) or the kernel transforms (need&nbsp;landmarks).&nbsp;</div><div><br></div><div>I think &nbsp;using the Affine transform will save you a lot of headache and extra</div><div><br></div><div>work, so use that&nbsp;one if it suits your
 application.&nbsp;</div><div><br></div><div>You can make the transformation&nbsp;interactive by changing&nbsp;the transformation parameters</div><div><br></div><div>based on user input or use the&nbsp;kernel transforms which&nbsp;require a set of landmarks. There</div><div><br></div><div>are plenty of code samples&nbsp;available in the "examples"&nbsp;directory of the ITK for all of the</div><div><br></div><div>aforementioned approaches&nbsp;and of course the software&nbsp;guide has further details,</div><div><br></div><div>documentation-wise :)</div><div><br></div><div>You can generate a mask image using the ImageMaskSpatialObject, a sample code</div><div><br></div><div>is included in the "examples" directory of the ITK&nbsp;(Examples\SpatialObjects\</div><div><br></div><div>ImageMaskSpatialObject.cxx).</div><div><br></div><div>Let us know if you had anymore
 problems.</div><div><br></div><div>HTH,</div><div><br></div><div>Dawood</div><div><br></div><div><br>--- On <b>Tue, 3/8/11, Xiaopeng Yang <i>&lt;yxp233@postech.ac.kr&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Xiaopeng Yang &lt;yxp233@postech.ac.kr&gt;<br>Subject: RE: Concept for edting segmented mask images<br>To: "'Dawood Masslawi'" &lt;davoud_zzz@yahoo.com&gt;<br>Cc: insight-users@itk.org<br>Date: Tuesday, March 8, 2011, 11:19 AM<br><br><div id="yiv1097725968"><style><!--
#yiv1097725968  
 _filtered #yiv1097725968 {font-family:Batang;panose-1:2 3 6 0 0 1 1 1 1 1;}
 _filtered #yiv1097725968 {font-family:宋体;panose-1:2 1 6 0 3 1 1 1 1 1;}
 _filtered #yiv1097725968 {font-family:宋体;panose-1:2 1 6 0 3 1 1 1 1 1;}
 _filtered #yiv1097725968 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}
 _filtered #yiv1097725968 {font-family:"Malgun Gothic";panose-1:0 0 0 0 0 0 0 0 0 0;}
 _filtered #yiv1097725968 {font-family:Consolas;panose-1:2 11 6 9 2 2 4 3 2 4;}
 _filtered #yiv1097725968 {panose-1:2 3 6 0 0 1 1 1 1 1;}
 _filtered #yiv1097725968 {panose-1:2 1 6 0 3 1 1 1 1 1;}
 _filtered #yiv1097725968 {}
#yiv1097725968  
#yiv1097725968 p.yiv1097725968MsoNormal, #yiv1097725968 li.yiv1097725968MsoNormal, #yiv1097725968 div.yiv1097725968MsoNormal
        {margin:0in;margin-bottom:.0001pt;font-size:12.0pt;font-family:"serif";}
#yiv1097725968 a:link, #yiv1097725968 span.yiv1097725968MsoHyperlink
        {color:blue;text-decoration:underline;}
#yiv1097725968 a:visited, #yiv1097725968 span.yiv1097725968MsoHyperlinkFollowed
        {color:purple;text-decoration:underline;}
#yiv1097725968 pre
        {margin:0in;margin-bottom:.0001pt;font-size:10.0pt;font-family:"Courier New";}
#yiv1097725968 span.yiv1097725968apple-style-span
        {}
#yiv1097725968 span.yiv1097725968HTMLChar
        {font-family:Consolas;}
#yiv1097725968 span.yiv1097725968EmailStyle20
        {font-family:"sans-serif";color:#1F497D;}
#yiv1097725968 .yiv1097725968MsoChpDefault
        {}
 _filtered #yiv1097725968 {margin:1.0in 1.25in 1.0in 1.25in;}
#yiv1097725968 div.yiv1097725968WordSection1
        {}
--></style><div class="yiv1097725968WordSection1"><p class="yiv1097725968MsoNormal"><span style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;">Hi Dawood,</span></p><p class="yiv1097725968MsoNormal"><span style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;"> &nbsp;</span></p><p class="yiv1097725968MsoNormal"><span style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;">Thanks very much for your help!</span></p><p class="yiv1097725968MsoNormal"><span style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;"> &nbsp;</span></p><p class="yiv1097725968MsoNormal"><span style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;">Could you suggest one specific edge detection filter in the ITK?</span></p><p class="yiv1097725968MsoNormal"><span style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;"> &nbsp;</span></p><p
 class="yiv1097725968MsoNormal"><span style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;">In my case, I need to shear and inflate the contours. Could you suggest which transformation function in the ITK is the best for these two changes? And how to apply the transformation function to shear and inflate the contours? Is it interactive?</span></p><p class="yiv1097725968MsoNormal"><span style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;"> &nbsp;</span></p><p class="yiv1097725968MsoNormal"><span style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;">And how to generate mask images after resampling?</span></p><p class="yiv1097725968MsoNormal"><span style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;"> &nbsp;</span></p><p class="yiv1097725968MsoNormal"><span style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;">Sorry for my limited knowledge on these
 topics. I raised many questions.</span></p><p class="yiv1097725968MsoNormal"><span style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;"> &nbsp;</span></p><p class="yiv1097725968MsoNormal"><span style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;">Best regards,</span></p><p class="yiv1097725968MsoNormal"><span style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;">Yang</span></p><p class="yiv1097725968MsoNormal"><span style="font-size:11.0pt;font-family:&quot;sans-serif&quot;;color:#1F497D;"> &nbsp;</span></p><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in;"><p class="yiv1097725968MsoNormal"><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:宋体;"> Dawood Masslawi [mailto:davoud_zzz@yahoo.com] <br><b><span
 lang="ZH-CN">发送时间</span>:</b> 2011</span><span lang="ZH-CN" style="font-size:10.0pt;font-family:&quot;serif&quot;;">년</span><span style="font-size:10.0pt;font-family:宋体;"> 3</span><span lang="ZH-CN" style="font-size:10.0pt;font-family:&quot;serif&quot;;">월</span><span style="font-size:10.0pt;font-family:宋体;"> 9</span><span lang="ZH-CN" style="font-size:10.0pt;font-family:&quot;serif&quot;;">일</span><span lang="ZH-CN" style="font-size:10.0pt;font-family:宋体;"> </span><span lang="ZH-CN" style="font-size:10.0pt;font-family:&quot;serif&quot;;">수요일</span><span lang="ZH-CN" style="font-size:10.0pt;font-family:宋体;"> </span><span lang="ZH-CN" style="font-size:10.0pt;font-family:&quot;serif&quot;;">오전</span><span style="font-size:10.0pt;font-family:宋体;"> 12:57<br><b><span lang="ZH-CN">收件人</span>:</b> yxp233@postech.ac.kr<br><b><span lang="ZH-CN">抄送</span>:</b> insight-users@itk.org<br><b><span
 lang="ZH-CN">主题</span>:</b> RE: Concept for edting segmented mask images</span></p></div><p class="yiv1097725968MsoNormal"> &nbsp;</p><table class="yiv1097725968MsoNormalTable" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td valign="top" style="padding:0in 0in 0in 0in;"><div id="yiv1097725968"><table class="yiv1097725968MsoNormalTable" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:0in 0in 0in 0in;"><p class="yiv1097725968MsoNormal"><span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;">Hi Xiaopeng,</span></p><div><p class="yiv1097725968MsoNormal"><span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;"> &nbsp;</span></p></div><div><p class="yiv1097725968MsoNormal"><span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;">You can use one of the available edge detection filters in the ITK to extract the boundary&nbsp;</span></p></div><div><p class="yiv1097725968MsoNormal"><span
 style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;"> &nbsp;</span></p></div><div><p class="yiv1097725968MsoNormal"><span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;">contours. Changing the shape of the contours could be a little bit more tricky, my</span></p></div><div><p class="yiv1097725968MsoNormal"><span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;"> &nbsp;</span></p></div><div><p class="yiv1097725968MsoNormal"><span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;">suggestion&nbsp;is to adapt one of the transformation functions in the ITK based on the kind of</span></p></div><div><p class="yiv1097725968MsoNormal"><span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;"> &nbsp;</span></p></div><div><p class="yiv1097725968MsoNormal"><span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;">change you&nbsp;want to induce in the contours (e.g. scaling, shearing, inflation and
 etc.).&nbsp;</span></p></div><div><p class="yiv1097725968MsoNormal"><span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;"> &nbsp;</span></p></div><div><p class="yiv1097725968MsoNormal"><span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;">Of course there&nbsp;are&nbsp;numerous&nbsp;other ways as well, but ultimately the best option depends</span></p></div><div><p class="yiv1097725968MsoNormal"><span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;"> &nbsp;</span></p></div><div><p class="yiv1097725968MsoNormal"><span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;">on the kind of&nbsp;change you&nbsp;want to make.</span></p></div><div><p class="yiv1097725968MsoNormal"><span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;"> &nbsp;</span></p></div><div><p class="yiv1097725968MsoNormal"><span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;">After resampling you should have no problems
 generating the mask images.</span></p></div><div><p class="yiv1097725968MsoNormal"><span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;"> &nbsp;</span></p></div><div><p class="yiv1097725968MsoNormal"><span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;">Best regards,</span></p></div><div><p class="yiv1097725968MsoNormal"><span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;"> &nbsp;</span></p></div><div><p class="yiv1097725968MsoNormal"><span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;">Dawood</span></p></div><div><p class="yiv1097725968MsoNormal"><span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;"> &nbsp;</span></p></div><div><p class="yiv1097725968MsoNormal"><span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;"> &nbsp;</span></p></div><div><p class="yiv1097725968MsoNormal"><span
 style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;">&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; &nbsp;</span></p></div><div><p class="yiv1097725968MsoNormal"><span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;"> &nbsp;</span></p></div><div><p class="yiv1097725968MsoNormal"><span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;">&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; &nbsp;</span></p></div><div><p class="yiv1097725968MsoNormal"><span
 style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;"> &nbsp;</span></p></div><div><p class="yiv1097725968MsoNormal"><span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;"> &nbsp;</span></p></div><div><pre>Dear Users,</pre><pre> &nbsp;</pre><pre> </pre><pre> &nbsp;</pre><pre>I utilized itk segmentation algorithm to extract the liver from CT images.</pre><pre>The results are a series of binary images (mask images). For editing the</pre><pre>binary images, for example deleting some part, I have an idea as follows.</pre><pre> &nbsp;</pre><pre> </pre><pre> &nbsp;</pre><pre>First, generating boundary contours from binary images.</pre><pre> &nbsp;</pre><pre>Second, changing the shape of the contours.</pre><pre> &nbsp;</pre><pre>Finally, generating mask images from the edited contours.</pre><pre> &nbsp;</pre><pre> </pre><pre> &nbsp;</pre><pre>Could you tell me whether this idea is feasible or not? If not, please give</pre><pre>me better
 ideas.</pre><pre> &nbsp;</pre><pre> </pre><pre> &nbsp;</pre><pre>Thanks,</pre><pre> &nbsp;</pre><pre>Yang</pre></div></td></tr></tbody></table></div></td></tr></tbody></table><p class="yiv1097725968MsoNormal"><span style="font-size:10.0pt;font-family:&quot;sans-serif&quot;;"> &nbsp;</span></p></div></div></blockquote></div></td></tr></table><br>