ITK  5.0.0
Insight Segmentation and Registration Toolkit
WikiExamples/SimpleOperations/PixelInsideRegion.cxx
#include "itkImageRegion.h"
#include "itkIndex.h"
#include "itkSize.h"
int main(int, char *[])
{
size.Fill(3);
start.Fill(0);
RegionType region(start,size);
itk::Index<2> testPixel1;
testPixel1[0] = 1;
testPixel1[1] = 1;
itk::Index<2> testPixel2;
testPixel2[0] = 6;
testPixel2[1] = 6;
std::cout << region.IsInside(testPixel1) << std::endl;
std::cout << region.IsInside(testPixel2) << std::endl;
return EXIT_SUCCESS;
}