<div dir="ltr">Hi Jay,<div><br></div><div>I am not sure that I fully understand your question, then.</div><div><br></div><div>Matt</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 2, 2017 at 11:01 AM, jay nanavati <span dir="ltr"><<a href="mailto:jaysnanavati@hotmail.co.uk" target="_blank">jaysnanavati@hotmail.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div dir="auto">
<div>Hi Matt,</div>
<div id="m_-8834993101024510280AppleMailSignature"><br>
</div>
<div id="m_-8834993101024510280AppleMailSignature">I think your answer might be referring to my original question. But I could you please confirm my understanding on the painting of all of the SE points.</div>
<div id="m_-8834993101024510280AppleMailSignature"><br>
</div>
<div id="m_-8834993101024510280AppleMailSignature">Thanks,</div>
<div id="m_-8834993101024510280AppleMailSignature">Jay</div><div><div class="h5">
<div><br>
On 2 Jun 2017, at 15:57, Matt McCormick <<a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a>> wrote:<br>
<br>
</div>
<blockquote type="cite">
<div>
<div dir="ltr">Hi Jay,
<div><br>
</div>
<div>Yes, outputRegion.IsInside(idx) means that we only are changing the region we are processing.</div>
<div><br>
</div>
<div>HTH,</div>
<div>Matt</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Jun 1, 2017 at 7:26 AM, jay nanavati <span dir="ltr">
<<a href="mailto:jaysnanavati@hotmail.co.uk" target="_blank">jaysnanavati@hotmail.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div dir="ltr">
<div id="m_-8834993101024510280m_-1283682266465248180x_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> NeighborIndexContaine<wbr>r<span style="color:#b4b4b4">::</span>const_iterator itIdx<span style="color:#b4b4b4">;</span>
      NeighborIndexContainer <span style="color:#b4b4b4">&</span><wbr> idxDifferenceSet <span style="color:#b4b4b4">=</span>
        <span style="color:#569cd6">this</span><span style="color:#b4b4b4">-></span>GetDifferenceSet<span style="color:#b4b4b4"><wbr>(</span>centerPixelCode<span style="color:#b4b4b4">);</span>
      <span style="color:#569cd6">for</span> <span style="color:#b4b4b4">(</span> itIdx <span style="color:#b4b4b4">=</span> idxDiffere<wbr>nceSet<span style="color:#b4b4b4">.</span>begin<span style="color:#b4b4b4">();</span>
            itIdx <span style="color:#b4b4b4">!=</span> idxDiffer<wbr>enceSet<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> tmpReg<wbr>IndexIt<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>IsIn<wbr>side<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"><wbr>,</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 style="display:inline-block;width:98%">
<div id="m_-8834993101024510280m_-1283682266465248180x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Matt McCormick <<a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a>><br>
<b>Sent:</b> 29 May 2017 18:41:13<br>
<b>To:</b> jay nanavati<br>
<b>Cc:</b> <a href="mailto:community@itk.org" target="_blank">community@itk.org</a><br>
<b>Subject:</b> Re: [ITK] Binary Dilate/Erode filter</font>
<div> </div>
</div>
</div>
<div>
<div class="m_-8834993101024510280h5"><font size="2"><span style="font-size:10pt">
<div class="m_-8834993101024510280m_-1283682266465248180PlainText">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>
<<a href="mailto:jaysnanavati@hotmail.co.uk" target="_blank">jaysnanavati@hotmail.co.uk</a>> wrote:<br>
> Hi - Looking at<br>
> ITK\Modules\Filtering\BinaryMa<wbr>thematicalMorphology\include\i<wbr>tkBinaryErodeImageFilter.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(<wbr>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<wbr>(padBy);<br>
>   tmpRequestedRegion.Crop(padded<wbr>InputRegion);<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.PadByRadi<wbr>us( 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>
> ______________________________<wbr>_________________<br>
> Community mailing list<br>
> <a href="mailto:Community@itk.org" target="_blank">Community@itk.org</a><br>
> <a href="http://public.kitware.com/mailman/listinfo/community" target="_blank">
http://public.kitware.com/mail<wbr>man/listinfo/community</a><br>
><br>
</div>
</span></font></div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</div></div></div>

</blockquote></div><br></div>