What PixelType are you using? Your PixelType must be char (1 byte). &#39;0 as bg and 1 as fg&#39; will work (without specifying the DilateValue) only if your PixelType is 1 bit long.<br><br>Saurabh<br><br><div class="gmail_quote">
On Tue, Oct 2, 2012 at 12:23 PM, Ariel Hernán Curiale <span dir="ltr">&lt;<a href="mailto:curiale@gmail.com" target="_blank">curiale@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Ok, then I don&#39;t know why I need to Rescale the intensity to 255 to get a properly output. When I use the default value (o background and 1 foreground) the dilate doesn&#39;t work.<div>
<br></div><div><div class="im"> <br><div>
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">
<span style="border-collapse:separate;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">
<span style="border-collapse:separate;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">
<span style="border-collapse:separate;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">
<span style="border-collapse:separate;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">
<span style="border-collapse:separate;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">
<span style="border-collapse:separate;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">
<span style="border-collapse:separate;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">
<div><div style="font-style:normal;font-size:medium;font-family:Helvetica;font-weight:normal"><div style="font-style:normal;font-size:medium;font-family:Helvetica;font-weight:normal">Thanks,</div><div style="font-style:normal;font-size:medium;font-family:Helvetica;font-weight:normal">
__________________________________<br><font color="#b7bfc5">|</font> Ariel Hernán Curiale Ph.D Student<br><font color="#b7bfc5">|</font> ETSI Telecomunicación<br><font color="#b7bfc5">|</font> Universidad de Valladolid<br>
<font color="#b7bfc5">|</font> Campus Miguel Delibes<br><font color="#b7bfc5">|</font> 47011 Valladolid, Spain<br><font color="#b7bfc5">|</font> Phone: 983-423000 ext. 5590</div><div><font style="font-family:Helvetica;font-size:medium;font-weight:normal;font-style:normal" color="#b7b7b7">|</font> Web: <a href="http://www.curiale.com.ar/" target="_blank"><font color="#084ebe">www.curiale.com.ar</font></a><br>
<font style="font-family:Helvetica;font-size:medium;font-weight:normal;font-style:normal" color="#b7b7b7">|</font><span style="font-style:normal;font-size:medium;font-family:Helvetica;font-weight:normal">_________________________________</span></div>
</div></div></div></span></div></span></div></span></div></span></div></span></div></span></div></span></div></span></div></span></div></span></span>
</div>
<br></div><div><div>El 02/10/2012, a las 20:22, Saurabh Garg escribió:</div><div><div class="h5"><br><blockquote type="cite">Hi Ariel,<br><br>It is an option in case your foreground value is different than default. DilateValue defaults to the maximum possible value of the PixelType.<br>
<br>HTH,<br>Saurabh<br><br><div class="gmail_quote">On Tue, Oct 2, 2012 at 11:12 AM, Ariel Hernán Curiale <span dir="ltr">&lt;<a href="mailto:curiale@gmail.com" target="_blank">curiale@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">
Hi Saurabh,<div><br></div><div>I can use SetDilateValue or I must use it ? </div><div>
Because I saw this information but I assume that by default all pixel &gt;0 are treated like one. And in the wiki (<a href="http://www.itk.org/Wiki/ITK/Examples/Morphology/BinaryDilateImageFilter" target="_blank">http://www.itk.org/Wiki/ITK/Examples/Morphology/BinaryDilateImageFilter</a>) they don&#39;t use SetDilateValue because the image is binary.</div>

<div><br></div><div><br></div><div><div><div>
<div style="word-wrap:break-word"><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">

<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">

<span style="border-collapse:separate;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">

<span style="border-collapse:separate;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">

<span style="border-collapse:separate;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">

<span style="border-collapse:separate;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">

<span style="border-collapse:separate;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">

<span style="border-collapse:separate;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">

<span style="border-collapse:separate;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">

<div><div style="font-style:normal;font-size:medium;font-family:Helvetica;font-weight:normal"><div style="font-style:normal;font-size:medium;font-family:Helvetica;font-weight:normal">Thanks,</div><div style="font-style:normal;font-size:medium;font-family:Helvetica;font-weight:normal">

__________________________________<br><font color="#b7bfc5">|</font> Ariel Hernán Curiale Ph.D Student<br><font color="#b7bfc5">|</font> ETSI Telecomunicación<br><font color="#b7bfc5">|</font> Universidad de Valladolid<br>

<font color="#b7bfc5">|</font> Campus Miguel Delibes<br><font color="#b7bfc5">|</font> 47011 Valladolid, Spain<br><font color="#b7bfc5">|</font> Phone: 983-423000 ext. 5590</div><div><font style="font-family:Helvetica;font-size:medium;font-weight:normal;font-style:normal" color="#b7b7b7">|</font> Web: <a href="http://www.curiale.com.ar/" target="_blank"><font color="#084ebe">www.curiale.com.ar</font></a><br>

<font style="font-family:Helvetica;font-size:medium;font-weight:normal;font-style:normal" color="#b7b7b7">|</font><span style="font-style:normal;font-size:medium;font-family:Helvetica;font-weight:normal">_________________________________</span></div>

</div></div></div></span></div></span></div></span></div></span></div></span></div></span></div></span></div></span></div></span></div>
</div>
<br></div><div><div>El 02/10/2012, a las 20:02, Saurabh Garg escribió:</div><div><div><br><blockquote type="cite">Hi Ariel,<br><br>You can use &quot;SetDilateValue&quot; to tell the Binary dilate filter, the value of your foreground pixel.<br>

<br>HTH,<br>Saurabh<br><br><div class="gmail_quote">On Tue, Oct 2, 2012 at 9:53 AM, Ariel Hernán Curiale <span dir="ltr">&lt;<a href="mailto:curiale@gmail.com" target="_blank">curiale@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi,<div><br></div><div><div>I&#39;m trying to implement a BinaryDilate over a mask image (0 and 1) and after read the class api I was sure that I will could do it :) but after a while the the dilate filter always return the same image as input.  </div>


<div>Reading the itkSoftwareGuide I found to my surprise that the input of the dilated image (in the example of the page 174) was  0 for the background and 255 for non-background. I did this change using a RescaleIntensityImage and the dilate filter work properly.</div>


<div><br></div><div>Anyone knows What is exactly the values of intensity that I need to use when in ITK  say binary image ? </div></div><div><div>In the api say that &quot;The structuring element is assumed to be composed of binary values (zero or one)&quot;, Why didn&#39;t  work the dilate using a binary image ?</div>


</div><div><br></div><div><br></div><div><div>
<div style="word-wrap:break-word"><div style="word-wrap:break-word"><div style="word-wrap:break-word"><div style="word-wrap:break-word"><span style="border-collapse:separate;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">


<span style="border-collapse:separate;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">


<span style="border-collapse:separate;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">


<span style="border-collapse:separate;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">


<span style="border-collapse:separate;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">


<span style="border-collapse:separate;font-variant:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">


<div><div style="font-style:normal;font-size:medium;font-family:Helvetica;font-weight:normal"><div style="font-style:normal;font-size:medium;font-family:Helvetica;font-weight:normal">Thanks,</div><div style="font-style:normal;font-size:medium;font-family:Helvetica;font-weight:normal">


__________________________________<br><font color="#b7bfc5">|</font> Ariel Hernán Curiale Ph.D Student<br><font color="#b7bfc5">|</font> ETSI Telecomunicación<br><font color="#b7bfc5">|</font> Universidad de Valladolid<br>


<font color="#b7bfc5">|</font> Campus Miguel Delibes<br><font color="#b7bfc5">|</font> 47011 Valladolid, Spain<br><font color="#b7bfc5">|</font> Phone: 983-423000 ext. 5590</div><div><font style="font-family:Helvetica;font-size:medium;font-weight:normal;font-style:normal" color="#b7b7b7">|</font> Web: <a href="http://www.curiale.com.ar/" target="_blank"><font color="#084ebe">www.curiale.com.ar</font></a><br>


<font style="font-family:Helvetica;font-size:medium;font-weight:normal;font-style:normal" color="#b7b7b7">|</font><span style="font-style:normal;font-size:medium;font-family:Helvetica;font-weight:normal">_________________________________</span></div>


</div></div></div></span></div></span></div></span></div></span></div></span></div></span></div></div></div></div>
</div>
<br></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://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>
</blockquote></div></div></div><br></div></div></blockquote></div><br>
</blockquote></div></div></div><br></div></div></blockquote></div><br>