[Insight-developers] FloodFilledSpatialFunctionIterator

Stephen R. Aylward aylward@unc.edu
Tue, 05 Jun 2001 16:26:46 -0400


> >                         SpatialIterator
> >            -------------------+-----------------------
> >            |                                         |
> >       FilledSpatialIterator            SurfaceSpatialIterator
> >     |------+-----------------------|
> > FunctionFilledSpatialIterator  MaskFilledSpatialIterator
> 
> Could you elaborate a bit on the class relationships?

SpatialIterator would define an API and maybe do some basic
initialization of stuff - mainly it provides an API.

FilledSpatialIterator would contain most of the code.   It would step
though voxels and test each voxel via a call to a virtual function let's
call it "testVoxel"

FunctionFilledSpatialIterator would implement "testVoxel" by evaluating
a function and it would provide an API for setting the function

MaskFilledSpatialIterator would provde an API for setting a mask and
it's implementation of "testVoxel" would see if the mask value at that
voxel passes some criterion.

SurfaceSpatialIterator does as you said - it tests for a voxel being on
an edge of an object.   It too would call a "testVoxel" at each voxel to
see if it is part of the object.   So, SurfaceSpatialIterator would also
need to be derived...okay an even better design is obvious:

Create a class that impliments "testVoxel" for functions and another
that impliments "testVoxel" for masks.   Then pass those classes as
template arguments to the FilledSpatialIterator and the 

> 
> I can see that SpatialIterator would iterate over a linked list of indices
> rather than over an image region. I'm not sure about the rest though... is
> the distinction between a surface and filled iterator whether or not you're
> interested in:
> 
> 1) All pixels "inside the function", resulting in a filled iterator
> 2) All pixels "inside the function" that are neighbors of a pixel not inside
> the function, resulting in a surface iterator
> 
> Also, perhaps elaborate on the differences between Function and Mask filled
> iterators?
> 
> Thanks,
> 
> -Damion-

-- 
===============================================
Stephen R. Aylward
Assistant Professor of Radiology
Adjunct Assistant Professor of Computer Science
http://www.cs.unc.edu/~aylward
aylward@unc.edu
(919) 966-9695