int
main(int argc, char * argv[])
{
if (argc < 3)
{
std::cout << "Usage: " << argv[0] << " imageFile1 imageFile2" << std::endl;
return EXIT_FAILURE;
}
interpolator->SetInputImage(fixedImage);
metric->SetFixedImage(fixedImage);
metric->SetMovingImage(movingImage);
metric->SetFixedImageRegion(fixedImage->GetLargestPossibleRegion());
metric->SetTransform(transform);
metric->SetInterpolator(interpolator);
TransformType::ParametersType params(transform->GetNumberOfParameters());
params.Fill(0.0);
metric->Initialize();
for (double x = -10.0; x <= 10.0; x += 5.0)
{
params(0) = x;
for (double y = -10.0; y <= 10.0; y += 5.0)
{
params(1) = y;
std::cout << params << ": " << metric->GetValue(params) << std::endl;
}
}
return EXIT_SUCCESS;
}