[Insight-developers] boundary faces calculator bug

wanlin wanlinzhu at gmail.com
Thu Apr 19 03:44:59 EDT 2012


I submitted a new patch. It should be able to handle all the cases.

http://review.source.kitware.com/#/c/5213/

Cheer

wanlin


On Wed, Apr 18, 2012 at 5:41 PM, wanlin <wanlinzhu at gmail.com> wrote:

>
> In the case of [5,1], the image bufferedRegion is index[0,0], size[5,1].
> requestToProcessRegion is the same as bufferedRegion.
> There is no NonBoundaryRegion with radius[1,1]. Meanwhile there is only
> one boundary region in the Y direction.
>
> I submit a patch which could address the issue.  However it could not
> handle requestToProcessRegion is inside of BoundaryRegion.
>
> best
>
>
> wanlin
>
> On Wed, Apr 18, 2012 at 12:35 AM, Kris Zygmunt <krismz at sci.utah.edu>wrote:
>
>>
>> On Apr 17, 2012, at 4:48 AM, wanlin wrote:
>>
>>
>>> Hi,
>>>   The current implementation of BoundaryFacesCalculator is based on the
>>> following assumption.
>>>
>>> There is an overlap between requestToProcessRegion and nonBounaryRegion
>>> of BufferedRegion.
>>>
>>> Hence the first region in the output list is the nonBoundaryRegion in
>>> requestToProcessRegion.
>>>
>>> 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.
>>>
>>> Should we change the implementationso the calculator could deal with any
>>> cases of requestToProcessRegion and BufferedRegion? I am willing to put a
>>> patch.
>>>
>>>
>>> thanks
>>>
>>>
>>> wanlin
>>>
>>>
>> 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.
>> Let's look at two 2-D cases, a) [5,5] and b) [5,1].
>>
>> In case a) the calculator returns the following regions:
>> Index[1, 1], Size [3, 3], 9 pixels
>> Index[0, 0], Size [1, 5], 5 pixels
>> Index[4, 0], Size [1, 5], 5 pixels
>> Index[1, 0], Size [3, 1], 3 pixels
>> Index[1, 4], Size [3, 1], 3 pixels
>> So all 25 pixels are visited once
>>
>> In case b), the calculator currently returns:
>> 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)
>> Index[0, 0], Size [1, 1], 1 pixel
>> Index[4, 0], Size [1, 1], 1 pixel
>> Index[1, 0], Size [3, 1], 3 pixels
>> Index[1, 0], Size [3, 1], 3 pixels
>> So 8 pixels are visited when there are only 5 pixels in the image.
>>
>> -Kris
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-developers/attachments/20120419/1352f126/attachment.htm>


More information about the Insight-developers mailing list