#include "itkExampleCostFunction.h"
using CostType = itk::ExampleCostFunction;
int
main()
{
optimizer->SetNumberOfIterations(100);
optimizer->UseCostFunctionGradientOff();
optimizer->SetCostFunction(cost.GetPointer());
CostType::ParametersType p(cost->GetNumberOfParameters());
p.Fill(1);
optimizer->SetInitialPosition(p);
optimizer->StartOptimization();
std::cout << "Position: " << optimizer->GetCurrentPosition() << std::endl;
std::cout << "Value: " << optimizer->GetValue() << std::endl;
return EXIT_SUCCESS;
}