But I get the following compiler error: error C2675: unary '++' : 'itk::ImageConstIterator<BoolImageType>' does not define this operator or a conversion to a type acceptable to the predefined operator
This error points to ++it;
I get the same error if I remove the custom typedef.
I’m using visual studio if that helps.
OK so after reading the documentation more in details I found out that itk::ImageConstIterator does not provide any means of moving the iterator. Same goes for itk::ImageIterator.
I was confused by the first documentation page that pops in google when searching for itk image iterator. https://itk.org/Doxygen/html/ImageIteratorsPage.html
The code samples there, even though they do not represent full programs somehow indicates the use of ImageIterator with the ++ operator.
replacing itk::ImageConstIterator with ImageRegionConstIterator solved my issue.