[Insight-developers] FloodFilledSpatialFunctionIterator

Damion Shelton dmsst59+@pitt.edu
Tue, 05 Jun 2001 12:47:59 -0400


Hi all...

I'm working on a new iterator class and was wondering if anyone has any
preliminary feedback on the concept.

Essentially, FloodFilledSpatialFunctionIterator allows you to iterate over
any group of contiguous pixels (with the n-dimensional equivalent of
4-connectivity) that can be defined as "inside" a spatial function. The
group of pixels is established by doing a conventional flood-fill given a
known starting index. The flood fill does not ensure a particular order of
traversal of pixels in the group, which is why I hesitate to call it a
region, but does allow you to iterate over an arbitrarily complex continuous
shape.

The iterator stores an internal linked list of the indices identified by the
fill operation, and ++ operations on FloodFilledSpatialFunctionIterator
actually iterate this internal list.

Right now, the steps to create and set up the iterator look like:

  typedef itk::FloodFilledSpatialFunctionIterator<TImageType,
TSphereFunctionType> TSphereItType;
  TSphereItType sfi = TSphereItType(sourceImage, spatialFunc);

  TImageType::IndexType seedPos;
  const unsigned long pos[] = {15,15,15};
  seedPos.SetIndex(pos);

  sfi.SetSeedPosition(seedPos);
  sfi.BuildIterator();

The iterator can then be used like a "normal" iterator.

Any comments?

Thanks,

-Damion-