[Insight-users] index to (neighborhood) iterator_solved
Gao, Yi
gaoyi.cn at gmail.com
Tue Feb 9 09:03:14 EST 2010
Thanks to njuptlw at 163.com, it's in guide chap 11.2 :)
On Mon, Feb 8, 2010 at 11:19 PM, Gao, Yi <gaoyi.cn at gmail.com> wrote:
> Dear all,
>
> This might be a silly question but is it possible to obtain a
> neighborhoodIterator from an index, with the center-of-neighborhood
> being that index?
>
> In fact this scenario is:
>
> 1st. I need to access arbitrary pixel value. So I have no choice but
> use things like GetPixel({{ix, iy, iz}})
>
> 2nd. After at (ix, iy, iz), I want to compute the image gradient (1st
> order finite difference) there so I need to traverse its neighbors
> regularly.
>
> Currently I'm using something like GetPixel({{ix+1, iy, iz}}) -
> GetPixel({{ix-1, iy, iz}}) but I know it's slow.
>
> Is there a way to obtain an neighborhoodIterator from idx, then at
> least the 2nd step can be accelerated?
>
>
> Thanks in advance for any hint!
>
>
> Best
> yi
>
More information about the Insight-users
mailing list