I submitted a new patch. It should be able to handle all the cases. <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"><<a href="mailto:wanlinzhu@gmail.com">wanlinzhu@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>In the case of [5,1], the image bufferedRegion is index[0,0], size[5,1]. requestToProcessRegion is the same as bufferedRegion. <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. 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"><<a href="mailto:krismz@sci.utah.edu" target="_blank">krismz@sci.utah.edu</a>></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>
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] = 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. 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>