[Insight-users] Random acess pixels using iterators

Luis Ibanez luis.ibanez@kitware.com
Sun, 20 Apr 2003 10:28:35 -0400


Hi Fucang,

ImageIterators are designed as a fast way of
getting access to image data. Their speed derives
from the knowledge of a particular strategy for
visiting all the pixels.

If you need to access isolated pixels in the
image, all the advantages of iterators are lost.
In that case you can simply use the itk::Image
methods

       -  SetPixel()
       -  GetPixel()

Note however that this two methods are *very*
slow. So you may not want to use them for a
massive access to pixel data.

Could you give us more details on the type of
access you need to perform ?

There may be already an ITK iterator for the
process you want to perform...


Thanks


   Luis


--------------

Fucang Jia wrote:
> Hi Luis, hi everyone,
> 
> I want to access pixel data from an offset with itkImageRegionIterator 
> iterator, not from begin. But I have not find the member function 
> implement operator+=Offset, operator-=Offset, or 
> operator.SetPosition(OffsetIndex). The software guide does describe the 
> function. Are these function purposely not implemented, or I am wrong at 
> the point?
> 
> Thank you!
> 
> Fucang
> 
> 
>