using System;
namespace itk.simple.examples
{
public class DemonsRegistration1
{
public class IterationUpdate :
Command
{
{
this.filter = filter;
}
public override void Execute()
{
}
}
public static void Main(string[] args)
{
if (args.Length < 3)
{
Console.WriteLine("Usage: DemonsRegistration1 <fixedImageFile> <movingImageFile> <outputTransformFile>");
return;
}
matcher.SetNumberOfHistogramLevels(1024);
matcher.SetNumberOfMatchPoints(7);
matcher.ThresholdAtMeanIntensityOn();
movingImage = matcher.Execute(movingImage, fixedImage);
demons.SetNumberOfIterations(50);
demons.SetStandardDeviations(1.0);
var cmd = new IterationUpdate(demons);
demons.AddCommand(
EventEnum.sitkIterationEvent, cmd);
var displacementField = demons.Execute(fixedImage, movingImage);
Console.WriteLine("-------");
Console.WriteLine(string.Format("Number Of Iterations: {0}", demons.GetElapsedIterations()));
Console.WriteLine(string.Format(" RMS: {0}", demons.GetRMSChange()));
SimpleITK.WriteTransform(outTx, args[2]);
}
}
}
An implementation of the Command design pattern for callback.
Deformably register two images using the demons algorithm.
uint32_t GetElapsedIterations() const
Number of iterations run.
Normalize the grayscale values for a source image by matching the shape of the source image histogram...
EventEnum
Events which can be observed from ProcessObject.
PixelIDValueEnum
Enumerated values of pixelIDs.