using System;
namespace itk.simple.examples
{
{
{
m_Method = m;
}
public override void Execute()
{
Console.WriteLine("{0,3} = {1,10:F5}",
}
}
class ImageRegistrationMethodBSpline1
{
static void Main(string[] args)
{
if (args.Length < 3)
{
Console.WriteLine("Usage: {0} <fixedImageFile> <movingImageFile> <outputTransformFile>",
"ImageRegistrationMethodBSpline1");
return;
}
VectorUInt32 transformDomainMeshSize = new VectorUInt32();
{
transformDomainMeshSize.Add(8);
}
Transform tx = SimpleITK.BSplineTransformInitializer(fixedImage, transformDomainMeshSize);
Console.WriteLine("Initial Parameters:");
Console.Write("[" + initialParams[0].ToString("F5"));
for (int i = 1; i < initialParams.Count; i++)
{
Console.Write(", " + initialParams[i].ToString("F5"));
}
Console.WriteLine("]");
numberOfIterations: 100,
maximumNumberOfCorrections: 5,
maximumNumberOfFunctionEvaluations: 1000,
costFunctionConvergenceFactor: 1e7);
IterationUpdate cmd = new IterationUpdate(R);
Console.WriteLine("-------");
Image cimg = SimpleITK.Compose(simg1, simg2, SimpleITK.Divide(SimpleITK.Add(simg1, simg2), 2));
if (Environment.GetEnvironmentVariable("SITK_NOSHOW") == null)
{
SimpleITK.Show(cimg, "ImageRegistrationMethodBSpline1 Composition");
}
}
}
}
An implementation of the Command design pattern for callback.
An interface method to the modular ITKv4 registration framework.
void SetMetricAsCorrelation()
Use negative normalized cross correlation image metric.
void SetInterpolator(InterpolatorEnum Interpolator)
Set and get the interpolator to use.
Transform Execute(const Image &fixed, const Image &moving)
Optimize the configured registration problem.
void SetOptimizerAsLBFGSB(double gradientConvergenceTolerance=1e-5, unsigned int numberOfIterations=500, unsigned int maximumNumberOfCorrections=5, unsigned int maximumNumberOfFunctionEvaluations=2000, double costFunctionConvergenceFactor=1e+7, double lowerBound=std::numeric_limits< double >::min(), double upperBound=std::numeric_limits< double >::max(), bool trace=false)
Limited memory Broyden Fletcher Goldfarb Shannon minimization with simple bounds.
std::string GetOptimizerStopConditionDescription() const
unsigned int GetOptimizerIteration() const
double GetMetricValue() const
void SetInitialTransform(const Transform &transform)
Set the initial transform and parameters to optimize.
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.
Resample an image via a coordinate transform.
Image Execute(const Image &image1)
void SetInterpolator(InterpolatorEnum Interpolator)
void SetTransform(Transform Transform)
void SetReferenceImage(const Image &refImage)
void SetDefaultPixelValue(double DefaultPixelValue)
EventEnum
Events which can be observed from ProcessObject.
PixelIDValueEnum
Enumerated values of pixelIDs.