[Insight-users] ConstNeighborhoodIterator and RequestedRegion ...

Arnaud Garcia arnaud.garcia at sim.hcuge.ch
Mon Mar 13 15:40:02 EST 2006


hello again ;-),

it seems that the boundary flag of the ConstNeighborhoodIterator does 
not work when you set a requestedRegion instead of using the 
largestPossibleRegion as we do most of the time ...

Does anyone did a ConstNeighborhoodIterator with a sub-region and test 
the boundary condition?



Arnaud



    typedef typename itk::ConstNeighborhoodIterator < OutputImageType > 
NeighborhoodIteratorType;
    typename NeighborhoodIteratorType::RadiusType radius;
    radius.Fill (1);
    NeighborhoodIteratorType it (radius, m_Marker, 
m_Marker->GetRequestedRegion());      <=== set the RequestedRegion and 
not the largest !
    w = it.GetPixel (i, boundary);
            if (boundary)      <== test success even if we are outside 
the region !
            {       



More information about the Insight-users mailing list