[Insight-users] Operator '++' not defined for iterator

Sylvain Bernhardt sylvainb at ece.ubc.ca
Thu Feb 23 21:28:57 EST 2012


Hi all,
I encountered a little problem with my iterator in ITK4:

typedef unsigned short PixelType;
const unsigned int Dimension = 2;
typedef itk::Image<PixelType, Dimension> ImageType;
typedef itk::ImageConstIteratorWithIndex<ImageType> IteratorType;

ImageType::Pointer imgL = ImageType::New();
imgL = somereader->GetOutput();

IteratorType it(imgL, imgL->GetLargestPossibleRegion());

for(it = it.Begin(); !it.IsAtEnd(); ++it)
{
     ...
}

The compilation in VisualStudio 2008 gives me this error:

error C2675: unary '++' : 'IteratorType' does not define this operator 
or a conversion to a type acceptable to the predefined operator

Any thoughts ?

Regards,
Sylvain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120223/36784f32/attachment.htm>


More information about the Insight-users mailing list