<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<div>Hi Matt,</div>
<div><br>
</div>
<div>Thanks for the help on this, it makes sense now.</div>
<div><br>
</div>
<div>Also with regards to the following :</div>
<div>
<pre style="font-family:Consolas; font-size:13; color:gainsboro; background:#1e1e1e"><span style="color:#569cd6">typename</span> NeighborIndexContainer<span style="color:#b4b4b4">::</span>const_iterator itIdx<span style="color:#b4b4b4">;</span>
      NeighborIndexContainer <span style="color:#b4b4b4">&</span> idxDifferenceSet <span style="color:#b4b4b4">=</span>
        <span style="color:#569cd6">this</span><span style="color:#b4b4b4">-></span>GetDifferenceSet<span style="color:#b4b4b4">(</span>centerPixelCode<span style="color:#b4b4b4">);</span>
      <span style="color:#569cd6">for</span> <span style="color:#b4b4b4">(</span> itIdx <span style="color:#b4b4b4">=</span> idxDifferenceSet<span style="color:#b4b4b4">.</span>begin<span style="color:#b4b4b4">();</span>
            itIdx <span style="color:#b4b4b4">!=</span> idxDifferenceSet<span style="color:#b4b4b4">.</span>end<span style="color:#b4b4b4">();</span>
            <span style="color:#b4b4b4">++</span>itIdx <span style="color:#b4b4b4">)</span>
        <span style="color:#b4b4b4">{</span>
        IndexType idx <span style="color:#b4b4b4">=</span> tmpRegIndexIt<span style="color:#b4b4b4">.</span>GetIndex<span style="color:#b4b4b4">()</span> <span style="color:#b4b4b4">+</span> <span style="color:#b4b4b4">*</span>itIdx<span style="color:#b4b4b4">;</span>
        <span style="color:#569cd6">if</span> <span style="color:#b4b4b4">(</span> outputRegion<span style="color:#b4b4b4">.</span>IsInside<span style="color:#b4b4b4">(</span>idx<span style="color:#b4b4b4">)</span> <span style="color:#b4b4b4">)</span>
          <span style="color:#b4b4b4">{</span>
          output<span style="color:#b4b4b4">-></span>SetPixel<span style="color:#b4b4b4">(</span>idx<span style="color:#b4b4b4">,</span> backgroundValue<span style="color:#b4b4b4">);</span>
          <span style="color:#b4b4b4">}</span>
        <span style="color:#b4b4b4">}</span></pre>
</div>
<div>Am I correct in understanding that the entire SE is being painted? and is the reason why this is done at least one to take care of an edge case where the radius of the SE is bigger than the surface being painted, which means just painting the surface points
 wont actually be correct? </div>
<div><br>
</div>
<div>Thanks,</div>
<div>Jay</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Matt McCormick <matt.mccormick@kitware.com><br>
<b>Sent:</b> 29 May 2017 18:41:13<br>
<b>To:</b> jay nanavati<br>
<b>Cc:</b> community@itk.org<br>
<b>Subject:</b> Re: [ITK] Binary Dilate/Erode filter</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Hi Jay,<br>
<br>
The region will be padded by the radius. The cropping will possibly<br>
shrink the region at the input image's boundaries.<br>
<br>
HTH,<br>
Matt<br>
<br>
On Mon, May 29, 2017 at 12:54 PM, jay nanavati<br>
<jaysnanavati@hotmail.co.uk> wrote:<br>
> Hi - Looking at<br>
> ITK\Modules\Filtering\BinaryMathematicalMorphology\include\itkBinaryErodeImageFilter.hxx,<br>
> I am a bit confused with regards to the padding and cropping of the regions<br>
> for example, in the snippet below:<br>
><br>
> ypename TInputImage::RegionType tmpRequestedRegion = outputRegion;<br>
>   typename TInputImage::RegionType paddedInputRegion =<br>
>     input->GetBufferedRegion();<br>
>   paddedInputRegion.PadByRadius(radius);   // to support boundary values<br>
>   InputSizeType padBy = radius;<br>
>   for ( i = 0; i < KernelDimension; ++i )<br>
>     {<br>
>     padBy[i] = ( padBy[i] > kernel.GetRadius(i) ? padBy[i] :<br>
> kernel.GetRadius(i) );<br>
>     }<br>
>   tmpRequestedRegion.PadByRadius(padBy);<br>
>   tmpRequestedRegion.Crop(paddedInputRegion);<br>
><br>
> It appears that tmpRequestedRegion is padded but then immediately cropped,<br>
> which means it will always be padded by a radius of 1 in each dimension<br>
> anyways? Similar operations are performed when padding the<br>
> inputRegionForThread:<br>
><br>
> // Pad the input region by the kernel<br>
>   inputRegionForThread.PadByRadius( kernel.GetRadius() );<br>
>   inputRegionForThread.Crop( input->GetBufferedRegion() );<br>
><br>
> It would be great if someone could guide me on this.<br>
><br>
> Thanks,<br>
> Jay<br>
><br>
><br>
> _______________________________________________<br>
> Community mailing list<br>
> Community@itk.org<br>
> <a href="http://public.kitware.com/mailman/listinfo/community">http://public.kitware.com/mailman/listinfo/community</a><br>
><br>
</div>
</span></font>
</body>
</html>