<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">This is a very interesting bug. That should require close attention.<div><br></div><div>When I have as many cores as slices, does this bug mean that I have been visiting each pixel multiple time?</div><div><br></div><div>Also I think I encountered this bug when I was trying to multithread the AnisotropicDiffusion's CalculateAverageGradientMagnitudeSquared method. I should likely revisit that issue.</div><div><br></div><div>Brad</div><div><br></div><div><br></div><div><br><div><div>On Apr 19, 2012, at 3:44 AM, wanlin wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">I submitted a new patch. It should be able to handle all the cases.&nbsp;<div><br></div><div><a href="http://review.source.kitware.com/#/c/5213/">http://review.source.kitware.com/#/c/5213/</a></div><div><br></div><div>Cheer</div>
<div><br></div><div>wanlin</div><div><br><br><div class="gmail_quote">On Wed, Apr 18, 2012 at 5:41 PM, wanlin <span dir="ltr">&lt;<a href="mailto:wanlinzhu@gmail.com">wanlinzhu@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; position: static; z-index: auto; ">
<br>In the case of [5,1], the image bufferedRegion is index[0,0], size[5,1]. requestToProcessRegion is the same as bufferedRegion.&nbsp;<div>There is no NonBoundaryRegion with radius[1,1]. Meanwhile there is only one boundary region in the Y direction.</div>

<div><br></div><div>I submit a patch which could address the issue. &nbsp;However it could not handle requestToProcessRegion is inside of BoundaryRegion.</div><div><br></div><div>best</div><span class="HOEnZb"><font color="#888888"><div>
<br></div><div><br></div><div>wanlin</div></font></span><div class="HOEnZb"><div class="h5">
<div><br><div class="gmail_quote">On Wed, Apr 18, 2012 at 12:35 AM, Kris Zygmunt <span dir="ltr">&lt;<a href="mailto:krismz@sci.utah.edu" target="_blank">krismz@sci.utah.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><br>
On Apr 17, 2012, at 4:48 AM, wanlin wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Hi,<br>
 &nbsp; The current implementation of BoundaryFacesCalculator is based on the following assumption.<br>
<br>
There is an overlap between requestToProcessRegion and nonBounaryRegion of BufferedRegion.<br>
<br>
Hence the first region in the output list is the nonBoundaryRegion in requestToProcessRegion.<br>
<br>
In your test, there is no overlap between requestToProcessRegion and bufferedRegion since requstToProcessRegion index[Dimension-1] = 1, which bufferedRegion index[Dimension - 1] = 0, size[Dimension - 1] &nbsp;= 1, . The ideal results ought to output 0 regions.<br>


<br>
Should we change the implementationso the calculator could deal with any cases of requestToProcessRegion and BufferedRegion? I am willing to put a patch.<br>
<br>
<br>
thanks<br>
<br>
<br>
wanlin<br>
<br>
</blockquote>
<br></div>
I don't think the correct answer is 0 regions if the purpose of the calculator is to break the image up into regions for iteration. &nbsp;The best way to tell that it is working is that each pixel in the image should be visited once and only once when iterating across the union of the regions returned by the calculator.<br>


Let's look at two 2-D cases, a) [5,5] and b) [5,1].<br>
<br>
In case a) the calculator returns the following regions:<br>
Index[1, 1], Size [3, 3], 9 pixels<br>
Index[0, 0], Size [1, 5], 5 pixels<br>
Index[4, 0], Size [1, 5], 5 pixels<br>
Index[1, 0], Size [3, 1], 3 pixels<br>
Index[1, 4], Size [3, 1], 3 pixels<br>
So all 25 pixels are visited once<br>
<br>
In case b), the calculator currently returns:<br>
Index[1, 1], Size [3, 0], 0 pixels (I think it is ok to return an empty region here as it indicates there are no interior points in the image)<br>
Index[0, 0], Size [1, 1], 1 pixel<br>
Index[4, 0], Size [1, 1], 1 pixel<br>
Index[1, 0], Size [3, 1], 3 pixels<br>
Index[1, 0], Size [3, 1], 3 pixels<br>
So 8 pixels are visited when there are only 5 pixels in the image.<span><font color="#888888"><br>
<br>
-Kris<br>
<br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
_______________________________________________<br>Powered by <a href="http://www.kitware.com">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Kitware offers ITK Training Courses, for more information visit:<br>http://kitware.com/products/protraining.php<br><br>Please keep messages on-topic and check the ITK FAQ at:<br>http://www.itk.org/Wiki/ITK_FAQ<br><br>Follow this link to subscribe/unsubscribe:<br>http://www.itk.org/mailman/listinfo/insight-developers<br></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">========================================================</font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">Bradley Lowekamp<span class="Apple-converted-space">&nbsp;</span><span class="Apple-converted-space">&nbsp;</span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">Medical Science and Computing for</font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">Office of High Performance Computing and Communications</font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">National Library of Medicine<span class="Apple-converted-space">&nbsp;</span></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; "><a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a></font></p><br class="Apple-interchange-newline"></span></div></span></span><br class="Apple-interchange-newline">
</div>
<br></div></body></html>