[Insight-users] (no subject)

Joshua Cates cates at sci . utah . edu
Fri, 23 Aug 2002 09:54:57 -0600 (MDT)


Hello,

The NeighborhoodIterator does not keep track of its position in the image.
If you use a SmartNeighborhoodIterator, you can query using the bool
InBounds() method.  Keep in mind, however, that this may be slow depending
on you application.

If your algorithm must operate on all pixels of an image, a good way to
approach the problem is to split the processing into two passes: one for
the non-boundary pixels and one for the boundary pixels.  The non-boundary
pixels can be processed quickly using the NeighborhoodIterator and the
boundary pixels can use a plug-in boundary condition supplied in the
SmartNeighborhoodIterator.  See itkNeighborhoodOperatorImageFilter for an
example of how this can be done.

Another approach is to check "manually". Both the ImageRegionIterator and the NeighborhoodIterator respond to
GetIndex.  You can check bounds by comparing the size and offset of the
region you are processing (Image::GetRequestedRegion) with the index returned.

Josh.

______________________________
 Josh Cates
 School of Computer Science
 University of Utah
 Email: cates@sci.utah.edu
 Phone: (801) 587-7697
 URL:   www.cs.utk.edu/~cates


On Fri, 23 Aug 2002, zhao wrote:

> Hi all,
> 	How to verify whether a pixels (accessed using an ImageRegionIterator or NeighborhoodIterator) is on the boundary of an image or not? Thanks!
>
> Zhao ChenGuang
> P.O.Box:010,
> Dept. BME,
> Shanghai Jiao Tong University,
> 1954# Hua Shan Road,
> Shanghai,P.R.China,
> 200030
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users
>