[Insight-users] index operate like C

David Doria daviddoria at gmail.com
Mon Feb 28 08:38:17 EST 2011


On Mon, Feb 28, 2011 at 8:26 AM, john smith <mkitkinsightuser at gmail.com>wrote:

> Hi to everyone,
>
>  I am beginner in developing my own filter and I am trying to find the
> maximum value of a neighborhood of 9 pixels and put this value into one
> pixel value of the output image. I am wandering if I could operate on my
> input image without using any iterators and using in their places index
> references, like in C. To be more specific, I suppose that I devide my input
> image into neighborhoods of nine pixels. The reference, to this pixels is
> made by using their index, for example (i,j)  for the central pixel and
> (i-1,j-1), (i,j-1), (i+1,j-1), (i-1,j), (i+1,j), (i-1,j+1), (i,j+1),
> (i+1,j+1) for the rest 8 pixels of the neighborhood. Could someone write how
> the for and while loops would look like, if it is possible to operate this
> way? I am using visualstudio 2010 and cmake.
>
> Thanks in advance
>

This is exactly what the neighborhood iterator does:

http://www.itk.org/Wiki/ITK/Examples/Iterators/ConstNeighborhoodIterator

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110228/0ebee252/attachment.htm>


More information about the Insight-users mailing list