[Insight-users] ++ overload in itkindex
luis.ibanez at kitware.com
Thu Jan 12 22:19:50 EST 2006
this operation of index increment is not available in ITK.
In part, because it is ill-defined in N-Dimensional images,
and in part because if you implement it on the index, then
there will be one and only one way of walking through all
the pixels of an image.
As Jim explained:
What we use is Image Iterators.
Please read the ITK Software Guide
in particular the chapter on "Image Iterators" on the
An image iterator can be initialized in a location
of the image, and then it will walk through the
pixels using the operator ++.
ITK offers a family of ImageIterators, that implement
different strategies on how to walk through the image.
What you probably want is the following code:
typedef itk::ImageRegionIterator< ImageType > IteratorType;
IteratorType it( image, image->GetBufferedRegion() );
while( !it.IsAtEnd() )
PixelType pp = it.Get();
This code will make the "it" image iterator walk
through the entire image.
You will find more details on the chapter of the
ITK Software Guide that we suggested above.
Eduardo Suarez wrote:
> If i have a
> itk::Image::RegionType foo;
> is it possible then to
> Miller, James V (GE, Research) wrote:
>> What would operator ++ and -- do on a multidimensional index?
>> Increment one component
>> of the index? Increment all components of the index?
>> If you want to move an index around an image, you an use an
>> -----Original Message-----
>> From: insight-users-bounces+millerjv=crd.ge.com at itk.org
>> [mailto:insight-users-bounces+millerjv=crd.ge.com at itk.org]On Behalf Of
>> Eduardo Suarez
>> Sent: Thursday, January 12, 2006 1:51 PM
>> To: insight-users at itk.org
>> Cc: Izzat Sabbagh Rodríguez
>> Subject: [Insight-users] ++ overload in itkindex
>> Just wondering why there is no overload of ++ and -- operators in
>> Insight-users mailing list
>> Insight-users at itk.org
> Insight-users mailing list
> Insight-users at itk.org
More information about the Insight-users