int
main(int, char *[])
{
image->SetRegions(region);
image->Allocate();
Iterator it(image, region);
short pixelValue = 0;
for (it.GoToBegin(); !it.IsAtEnd(); ++it, ++pixelValue)
{
it.Set(pixelValue);
}
imageSO->SetImage(image);
imageSO->Update();
auto insidePoint = itk::MakeFilled<Point>(9);
if (imageSO->IsInsideInWorldSpace(insidePoint))
{
std::cout << insidePoint << " is inside the image." << std::endl;
}
double returnedValue;
imageSO->ValueAtInWorldSpace(insidePoint, returnedValue);
std::cout << "ValueAt(" << insidePoint << ") = " << returnedValue
<< std::endl;
ImageSpatialObject::DerivativeVectorType returnedDerivative;
imageSO->DerivativeAtInWorldSpace(insidePoint, 1, returnedDerivative);
std::cout << "First derivative at " << insidePoint;
std::cout << " = " << returnedDerivative << std::endl;
return EXIT_SUCCESS;
}