#include <iostream>
#include <stdlib.h>
#include <iomanip>
using sitk::operator<<;
class IterationUpdate
{
public:
: m_Method(m)
{}
{
using sitk::operator<<;
if (m_Method.GetOptimizerIteration() == 0)
{
std::cout << m_Method.ToString() << std::endl;
}
std::ios state(NULL);
state.copyfmt(std::cout);
std::cout << std::fixed << std::setfill(' ') << std::setprecision( 5 );
std::cout << std::setw(3) << m_Method.GetOptimizerIteration();
std::cout << " = " << std::setw(10) << m_Method.GetMetricValue() << std::endl;
std::cout.copyfmt(state);
}
private:
};
int main(int argc, char *argv[])
{
if ( argc < 4 )
{
std::cerr << "Usage: " << argv[0] << " <fixedImageFilter> <movingImageFile> <outputTransformFile>" << std::endl;
return 1;
}
std::vector<unsigned int> transformDomainMeshSize(fixed.
GetDimension(),8);
std::cout <<
"Initial Parameters:" << tx.
GetParameters() << std::endl;
const double gradientConvergenceTolerance = 1
e-5;
const unsigned int maximumNumberOfIterations = 100;
const unsigned int maximumNumberOfCorrections = 5;
const unsigned int maximumNumberOfFunctionEvaluations = 1000;
const double costFunctionConvergenceFactor = 1e+7;
maximumNumberOfIterations,
maximumNumberOfCorrections,
maximumNumberOfFunctionEvaluations,
costFunctionConvergenceFactor);
IterationUpdate cmd(R);
std::cout << "-------" << std::endl;
std::cout << outTx.
ToString() << std::endl;
return 0;
}