using System;
namespace itk.simple.examples
{
{
{
m_Method = m;
}
public override void Execute()
{
Console.WriteLine("{0:3} = {1:10.5} : [{2}, {3}]",
pos[0], pos[1]);
}
}
class ImageRegistrationMethod2
{
static void Main(string[] args)
{
if (args.Length < 3)
{
Console.WriteLine("Usage: %s <fixedImageFilter> <movingImageFile> <outputTransformFile>\n", "ImageRegistrationMethod2");
return;
}
fixedImage = SimpleITK.Normalize(fixedImage);
SimpleITK.DiscreteGaussian(fixedImage, 2.0);
movingImage=SimpleITK.Normalize(movingImage);
movingImage = SimpleITK.DiscreteGaussian(movingImage, 2.0);
double learningRate = 1;
uint numberOfIterations = 200;
double convergenceMinimumValue = 1e-4;
uint convergenceWindowSize = 5;
numberOfIterations,
convergenceMinimumValue,
convergenceWindowSize);
IterationUpdate cmd = new IterationUpdate(R);
}
}
}
An implementation of the Command design pattern for callback.
Read an image file and return a SimpleITK Image.
Image Execute() override
Set/Get The output PixelType of the image.
Self & SetFileName(const PathType &fn)
Self & SetOutputPixelType(PixelIDValueEnum pixelID)
Set/Get The output PixelType of the image.
An interface method to the modular ITKv4 registration framework.
Self & SetInterpolator(InterpolatorEnum Interpolator)
Set and get the interpolator to use.
Transform Execute(const Image &fixed, const Image &moving)
Optimize the configured registration problem.
std::vector< double > GetOptimizerPosition() const
Self & SetMetricAsJointHistogramMutualInformation(unsigned int numberOfHistogramBins=20, double varianceForJointPDFSmoothing=1.5)
Use mutual information between two images.
unsigned int GetOptimizerIteration() const
double GetMetricValue() const
Self & SetInitialTransform(const Transform &transform)
Set the initial transform and parameters to optimize.
Self & SetOptimizerAsGradientDescentLineSearch(double learningRate, unsigned int numberOfIterations, double convergenceMinimumValue=1e-6, unsigned int convergenceWindowSize=10, double lineSearchLowerLimit=0, double lineSearchUpperLimit=5.0, double lineSearchEpsilon=0.01, unsigned int lineSearchMaximumIterations=20, EstimateLearningRateType estimateLearningRate=Once, double maximumStepSizeInPhysicalUnits=0.0)
Gradient descent optimizer with a golden section line search.
The Image class for SimpleITK.
unsigned int GetDimension() const
virtual int AddCommand(itk::simple::EventEnum event, itk::simple::Command &cmd)
Add a Command Object to observer the event.
EventEnum
Events which can be observed from ProcessObject.
PixelIDValueEnum
Enumerated values of pixelIDs.