[Insight-developers] recomendations for fast access to list of offsets

Jim Miller millerjv at gmail.com
Mon Jul 3 19:01:42 EDT 2006


Richard,

There is an iterator that will visit the pixels along an oriented line.
Would this
work for you?  itk::LineConstIterator and itk::LineIterator.

Jim

On 7/2/06, Richard Beare <richard.beare at gmail.com> wrote:
>
> Hi,
>
> I have a filter that will sweep lines of various orientations across
> an image. The lines will change angles between passes. I represent the
> line as an array of offsets from the starting point, and this
> representation is computed once for each sweep. The idea is to copy
> the pixel locations to a buffer for processing, and then copy them
> back when I'm done, which tends to simplify the interface to the core
> computational code and often improves cache performance when the
> buffered data is accessed lots of times.
>
> So what is the recommended way of accessing a bunch of pixels that
> aren't necessarily in one of the standard orderings? I've experimented
> with image.GetPixel() to get things working, which the documentation
> says is slow, and it shows signs of being a significant overhead. I've
> also toyed with using += operators with image region iterators, but it
> doesn't seem to be legal.
>
> Any recommendations?
>
> Thanks
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.itk.org/mailman/private/insight-developers/attachments/20060703/a8caa826/attachment.html


More information about the Insight-developers mailing list