int main(int, char* [])
{
typedef ImageMaskSpatialObject::PixelType PixelType;
typedef ImageMaskSpatialObject::ImageType ImageType;
ImageType::Pointer image = ImageType::New();
ImageType::RegionType region;
region.SetSize(size);
image->SetRegions( region );
image->Allocate(true);
ImageType::RegionType insideRegion;
insideRegion.SetSize( insideSize );
Iterator it( image, insideRegion );
it.GoToBegin();
while( !it.IsAtEnd() )
{
++it;
}
ImageMaskSpatialObject::Pointer maskSO = ImageMaskSpatialObject::New();
maskSO->SetImage(image);
std::cout << "Is my point " << inside << " inside my mask? "
<< maskSO->IsInside(inside) << std::endl;
std::cout << "Is my point " << outside << " outside my mask? "
<< !maskSO->IsInside(outside) << std::endl;
return EXIT_SUCCESS;
}