[Insight-developers] New iterator: RegionExclusion

Luis Ibanez luis.ibanez@kitware.com
Fri, 08 Feb 2002 20:50:59 -0500


Hi,

A new iterator has been added.  It is designed to walk over a
region (as the ImageRegionIterator) but skipping another region
specified by the user.

The second region is called the "Exclusion" region and is set
with the method :  SetExclusionRegion() after construction.

The intention of this iterator is to walk easily over the boundary
of an image.  For example, in the particular case of the DanielssonDistance
filter, we want to postprocess the distance map by visiting the pixels at
a distance 1 from the boundary of the image.  

This iterator achieve this by using an exclusion region that is just 2 
pixels
narrower along each dimension, and with a start index of  ones.


 Its use  looks like:


  typedef  itk::ImageRegionExclusionIteratorWithIndex<  ImageType > 
 IteratorType;
  IteratorType   it( myImage,  myRegion );

   it.SetExclusionRegion( myExclusionRegion );
   it.GoToBegin();
   while( !it.IsAtEnd() )
   {
      // here it.Get(),  it.Set()   or... it.GetIndex()....
      ++it;
   }






   Luis