[Insight-developers] Feedback wanted for additions to NeighborhoodIterator classes
Joshua Cates
cates@sci.utah.edu
Mon, 25 Nov 2002 11:02:38 -0700 (MST)
Hello all ITK developers and users:
I am planning to make some simple additions to the API of the neighborhood
iterator classes (and base classes) and would like some feedback.
I'm particularly interested in suggestions for naming of methods and
classes and any additional functionality that people would like to see in
the NeighborhoodIterators and NeighborhoodOperators.
Note that these changes will not break any existing applications, but new
applications could be written using this simplified API.
1) Add methods for convolution of two neighborhoods. Useful for
constructing convolution kernels from other convolution kernels.
itk::Neighborhood itk::NeighborhoodAlgorithm::Convolve(itk::Neighborhood,
itk::Neighborhood)
2) Add the following methods to itk::Neighborhood,
itk::(Const)NeighborhoodIterator, and
itk::(Const)SmartNeighborhoodIterator.
PixelType &GetNext(unsigned int Dimension, unsigned int distance = 1)
PixelType &GetPrevious(unsigned int Dimension, unsigned int distance = 1)
void SetNext(PixelType &v, unsigned int Dimension, unsigned int distance =1);
void SetPrevious(PixelType &v, unsigned int Dimension, unsigned int distance =1);
where step is a pixel distance from the center of the neighborhood in the
Dimension direction. For example, iterator.GetNext(0) would return the
value one pixel in the positive x direction. iterator.GetPrevious(2, 3)
would return the value three pixels in the negative z direction.
std::slice GetSlice(unsigned int Dimension)
Returns a 1D axial slice along Dimension. Can be used for convolution or
directional derivatives.
3) Create a new class which only manages pointers to the 2N-connected
neighbor pixels as it iterates in N dimensions. This should give some
speed advantage to simple algorithms in higher dimensions.
itk::CityBlockConnectedSmartNeighborhoodIterator
4) Other iterator types? I'm open to suggestions.
Thanks,
Josh.
______________________________
Josh Cates
School of Computer Science
University of Utah
Email: cates@sci.utah.edu
Phone: (801) 587-7697
URL: www.cs.utk.edu/~cates