[Insight-users] A question about neighborhood iterator and image iterator

Feng Ma mafeng at hotmail . com
Fri, 03 Oct 2003 20:03:06 -0400


Hi, Josh and Luis:

  I am a little confused about how to use neighborhood iterator and image 
iterator. Josh has a code example in ITK Neighborhood ppt file:

    typedef itk::Image<float, 3> ImageType;
    ImageType::Pointer image = SomeImageSource->GetOutput();

    itk::ConstNeighborhoodIterator<ImageType> it(radius, image,
                                                        
image->GetRequestedRegion());
    itk::ImageRegionIterator<ImageType> out(output_image,
									   image->GetRequestedRegion());

    for (it.GoToBegin(); ! it.IsAtEnd(); ++it, ++out)
    {
       out.Set(0.5 * it.GetNext(2) -  0.5 * it.GetPrevious(2));
    }

  How does ITK internal mechanism make sure that neighborhood iterator it 
and image region iterator out are always visiting the same pixel in image?

  Thanks.

-Feng

_________________________________________________________________
Share your photos without swamping your Inbox.  Get Hotmail Extra Storage 
today! http://join . msn . com/?PAGE=features/es