[Insight-developers] Filling a neighborhood from an index

Blezek, Daniel J (Research) blezek@crd.ge.com
Fri, 20 Sep 2002 08:42:25 -0400


ITK'ers,

  I would like to fill an itkNeighborhood with values from an image centered on an arbitrary index.
I know there is an itkNeighborhoodIterator that walks through the image and fills it's neighborhood
everytime you increment the iterator.  I could copy the code from this iterator into my code, but
would a more general solution be useful?

Something like this (please forgive the pseudo-code, it's hard enought to write itk code, much less
contrive a realistic example):

ImageInputIteratorType inIt = blah, blah, blah;
ImageOutputIteratorType outIt = blah, blah, blah;

while ( !inIt.isAtEnd() )
{
  InputNeighborhoodType n = inputImage->FillNeighborhood ( inIt.GetIndex(), (region|size|whatever) );
  while ( walkPixels )
  {
    smallest = <Find smallest from n>;
    newindex = index + smallest.GetIndex();
    n = inputImage->FillNeighborhood ( newindex, (region|size|whatever) );
    // more stuff
  }
  ++inIt;
  ++outIt;
}

  If such a beast exists, could someone clue me in?

Thanks,
-dan

--
Daniel Blezek, Ph.D.
blezek@crd.ge.com
Visualization and Computer Vision Lab, Imaging Technologies
GE Global Research Center