//********** ImageTypes
(FixedInternalImagePixelType "float")
(FixedImageDimension 2)
(MovingInternalImagePixelType "float")
(MovingImageDimension 2)
(UseDirectionCosines "true")

//********** Components
(Registration "MultiResolutionRegistration")
(FixedImagePyramid "FixedSmoothingImagePyramid")
(MovingImagePyramid "MovingSmoothingImagePyramid")
(Interpolator "BSplineInterpolator")
(Metric "AdvancedMattesMutualInformation")
(Optimizer "AdaptiveStochasticGradientDescent")
(ResampleInterpolator "FinalLinearInterpolator")
(Resampler "DefaultResampler")
(Transform "BSplineTransform")

// ********** Pyramid
// Total number of resolutions
(NumberOfResolutions 3)
(FixedImagePyramidSchedule 8 4 2 1)
(MovingImagePyramidSchedule 8 4 2 1)


// ********** Transform
//(CenterOfRotation 120 160) //center by default
(AutomaticTransformInitialization "true")
(AutomaticScalesEstimation "true")
(HowToCombineTransforms "Compose")

// ********** Optimizer
// Maximum number of iterations in each resolution level:
(MaximumNumberOfIterations 300 300 300)
(AutomaticParameterEstimation "true")
(UseAdaptiveStepSizes "true")

// ********** Metric
//Number of grey level bins in each resolution level:
(NumberOfHistogramBins 32)
(FixedKernelBSplineOrder 1)
(MovingKernelBSplineOrder 3)

// ********** Several
(WriteTransformParametersEachIteration "false")
(WriteTransformParametersEachResolution "false")
(ShowExactMetricValue "false")
(ErodeMask "true")

// ********** ImageSampler
// Number of spatial samples used to compute the
// mutual information in each resolution level:
(ImageSampler "RandomCoordinate")
(NumberOfSpatialSamples 2048)
(NewSamplesEveryIteration "true")

// ********** Interpolator and Resampler
//Order of B-Spline interpolation used in each resolution level:
(BSplineInterpolationOrder 1)
//Order of B-Spline interpolation used for applying the final deformation:
(FinalBSplineInterpolationOrder 3)
//Default pixel value for pixels that come from outside the picture:
(DefaultPixelValue 0)

(WriteResultImage "false" )
(CompressResultImage "false" )
(WriteResultImageAfterEachResolution "false")


// The pixel type and format of the resulting deformed moving image
(ResultImagePixelType "short")
(ResultImageFormat "mhd")