<div dir="ltr">Hi Hui,<div><br></div><div><div>Here's an explanation (someone more knowledgeable can correct me or explain it in a better way).<br></div><div><br></div><div>See [1]. The dilate (as well as the erode) filter considers as foreground those pixels which have a "DilateValue". If this value is not set, it defaults to the maximum possible value of the <i>PixelType </i>which in your case is the maximum value of the <i>signed int</i> type.</div><div><br></div><div>So, if you know the foreground value of your binary image, you might want to try setting this "DilateValue", by using <b>dilateFilter->SetDilateValue(). </b>You can also use the <span style="color:rgb(0,0,0)">MinimumMaximumImageCalculator to find the maximum value </span><span style="color:rgb(0,0,0)">(see [2])</span><span style="color:rgb(0,0,0)">.</span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div>As an aside, wouldn't it be better to use <i>unsigned char</i> instead of <i>int </i>in this case, since the image is binary?</div><div><br></div><div><br></div><div><span style="color:rgb(0,0,0)">[1] </span><font color="#000000"><a href="http://www.itk.org/Doxygen/html/classitk_1_1BinaryDilateImageFilter.html" target="_blank">http://www.itk.org/Doxygen/html/classitk_1_1BinaryDilateImageFilter.html</a></font></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">[2] </span><font color="#000000"><a href="http://www.itk.org/Doxygen/html/classitk_1_1MinimumMaximumImageCalculator.html#a39a9bfc33090e47df71d5b9cd6665ccb" target="_blank">http://www.itk.org/Doxygen/html/classitk_1_1MinimumMaximumImageCalculator.html#a39a9bfc33090e47df71d5b9cd6665ccb</a></font></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 31, 2014 at 10:58 AM, tanghui.seu <span dir="ltr"><<a href="mailto:tanghui.seu@gmail.com" target="_blank">tanghui.seu@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi Grish<br><br>Thanks a lot for your reply!<br>The dilate Filter outputs the same as the input image.<br><br>Image3DIntType is itk::image<int, 3><br>I correctly read in a binary image.<br><br>Sorry that i can not provide the code now..... it is in my workstation.<br>Thanks a lot again!<br><br><br>来自我的华为手机<div><div><br><br>Girish Mallya Udupi <<a href="mailto:indianzeppelin@gmail.com" target="_blank">indianzeppelin@gmail.com</a>> wrote:<br><br><div dir="ltr">Hi Hui,<div><br></div><div>Could you describe what exactly the problem is? Also, couId you also paste the earlier part of your code (where Image3DIntType and readerint are defined)?</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 31, 2014 at 8:53 AM, Hui Tang <span dir="ltr"><<a href="mailto:tanghui.seu@gmail.com" target="_blank">tanghui.seu@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>Dear all,</div><div> </div><div>I can not get dilation or erosion from BinaryDilateImageFilter  or BinaryErodeImageFilter </div><div> </div><div>I mostly copied from the example and thought it should work without any problems.</div><div> </div><div>Here is my code.</div><div>Anyone knows what is wrong here? Thanks a lot in advance !</div><div> </div><div><p class="MsoNormal"><span style="color:blue;font-family:NSimSun;font-size:9.5pt">unsigned</span><span style="font-family:NSimSun;font-size:9.5pt"> <span style="color:blue">int</span> radius = 7;</span></p><p class="MsoNormal"><span style="font-family:NSimSun;font-size:9.5pt"><span style="color:blue">typedef</span> itk::BinaryBallStructuringElement<<span style="color:blue">int</span>, 3>            StructuringElementType;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:NSimSun;font-size:9.5pt">       StructuringElementType structuringElement;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:NSimSun;font-size:9.5pt">       structuringElement.SetRadius(radius);<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:NSimSun;font-size:9.5pt">       structuringElement.CreateStructuringElement();</span></p><p class="MsoNormal"><span style="font-family:NSimSun;font-size:9.5pt"></span> </p><p class="MsoNormal"><span style="font-family:NSimSun;font-size:9.5pt">      <span style="color:blue">typedef</span> itk::BinaryDilateImageFilter <Image3DIntType, Image3DIntType, StructuringElementType> BinaryDilateImageFilterType;<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:NSimSun;font-size:9.5pt">       BinaryDilateImageFilterType::Pointer dilateFilter = BinaryDilateImageFilterType::New();<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:NSimSun;font-size:9.5pt">       dilateFilter->SetInput(readerint->GetOutput());<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:NSimSun;font-size:9.5pt">       dilateFilter->SetKernel(structuringElement);   <u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:NSimSun;font-size:9.5pt">       dilateFilter->Update();</span></p><p class="MsoNormal"><span style="font-family:NSimSun;font-size:9.5pt"></span> </p><p class="MsoNormal"><span style="font-family:NSimSun;font-size:9.5pt">Best,</span></p><span><font color="#888888"><p class="MsoNormal"><span style="font-family:NSimSun;font-size:9.5pt"></span> </p><p class="MsoNormal"><span style="font-family:NSimSun;font-size:9.5pt">Hui<u></u><u></u></span></p></font></span></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<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/insight-users" target="_blank">http://public.kitware.com/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr">Regards,<br>Girish</div></div>
</div></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr">Regards,<br>Girish</div></div>
</div></div>