[Insight-users] fast binary dilate image filter

Gaetan Lehmann gaetan.lehmann at jouy.inra.fr
Thu Feb 2 15:58:24 EST 2006


Hi Jerome,

I'm again working on binary dilate filter.

I don't understand what the last part of the code is for.

  while( !ouRegIndexIt.IsAtEnd() )
    {
    // Retrieve index of current output pixel
    IndexType currentIndex  = ouRegIndexIt.GetIndex();
    for( vecIt = vecBeginIt; vecIt != vecEndIt; ++vecIt )
      {
      // Translate
      IndexType translatedIndex = currentIndex - *vecIt;
 
      // translated index now is an index in input image in the 
      // output requested region padded. Theoretically, this translated
      // index must be inside the padded region.
      // If the pixel in the input image at the translated index
      // has a value equal to the dilate one, this means
      // that the output pixel at currentIndex will be on in the output.
      if( inputRegionForThread.IsInside( translatedIndex ) && 
input->GetPixel( translatedIndex ) == foregroundValue )
        {
        ouRegIndexIt.Set( foregroundValue );
        break; // Do not need to examine other offsets because at least one
        // input pixel has been translated on current output pixel.
        }
      }

    ++ouRegIndexIt;
    progress.CompletedPixel();
    }



In fact, if I drop this part, I get the same output image. Can you explain me 
the role of this code ?

Thanks,

Gaetan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/insight-users/attachments/20060202/0ad95e5d/attachment.pgp


More information about the Insight-users mailing list