[Insight-users] Problem with FloodFilledFunctionConditionalConstIterator

Mathias Seitel mathias . seitel at igd . fhg . de
Wed, 02 Jul 2003 10:47:27 +0200


Hello,

I'm applying a connected threshold segmentation to a volume 
(256x256x16). For testing purposes I extract one slice, say #12, of the 
volume, using ExtractImageFilter. The slice has an index of (0, 0, 12) 
and a size of (256, 256, 1). For the region growing algorithm I add a 
seed point at (150, 100, 12).

FloodFilledFunctionConditionalConstIterator::InitializeIterator() 
creates a temporary image with the same size as the original image but 
an index of (0, 0, 0). A set pixel
method called later on this image however uses the original seed (z = 
12) and thus calculates a wrong offset, which results in a runtime error.

With the following lines added to InitializeIterator() everything seems 
to work fine (at least in my case):

  IndexType imageIndex = m_Image->GetLargestPossibleRegion().GetIndex();
  tempRegion.SetIndex( imageIndex );

Regards,
Mathias