[Insight-developers] boundary faces calculator bug
Bradley Lowekamp
blowekamp at mail.nih.gov
Tue Apr 24 10:19:58 EDT 2012
This is a very interesting bug. That should require close attention.
When I have as many cores as slices, does this bug mean that I have been visiting each pixel multiple time?
Also I think I encountered this bug when I was trying to multithread the AnisotropicDiffusion's CalculateAverageGradientMagnitudeSquared method. I should likely revisit that issue.
Brad
On Apr 19, 2012, at 3:44 AM, wanlin wrote:
> 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
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers
========================================================
Bradley Lowekamp
Medical Science and Computing for
Office of High Performance Computing and Communications
National Library of Medicine
blowekamp at mail.nih.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-developers/attachments/20120424/e4df191b/attachment.htm>
More information about the Insight-developers
mailing list