[Insight-developers] boundary faces calculator bug

Kris Zygmunt krismz at sci.utah.edu
Tue Apr 17 12:35:35 EDT 2012


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



More information about the Insight-developers mailing list