using System;
namespace itk.simple.examples
{
class ImageRegistrationOptimizerWeights
{
static void Main(string[] args)
{
if (args.Length < 3)
{
Console.WriteLine("Usage: ImageRegistrationOptimizerWeights <fixedImageFile> <movingImageFile> <outputTransformFile>");
return;
}
Transform transform = SimpleITK.CenteredTransformInitializer(
fixedImage,
movingImage,
300,
1e-6,
10);
VectorDouble weights = new VectorDouble(new double[] { 0, 0, 1, 1, 1, 1 });
registrationMethod.
Execute(fixedImage, movingImage);
Console.WriteLine("-------");
Console.WriteLine(
"Final transform parameters: " + transform.
GetParameters());
Console.WriteLine(
"Metric value: " + registrationMethod.
GetMetricValue());
}
}
}
An interface method to the modular ITKv4 registration framework.
void SetMetricAsCorrelation()
Use negative normalized cross correlation image metric.
void SetOptimizerWeights(const std::vector< double > &weights)
A per parameter weighting array for the optimizer.
void SetMetricSamplingStrategy(MetricSamplingStrategyType strategy)
Set sampling strategy for sample generation.
void SetInterpolator(InterpolatorEnum Interpolator)
Set and get the interpolator to use.
Transform Execute(const Image &fixed, const Image &moving)
Optimize the configured registration problem.
std::string GetOptimizerStopConditionDescription() const
MetricSamplingStrategyType
Sampling strategies for obtaining points.
void SetOptimizerAsGradientDescent(double learningRate, unsigned int numberOfIterations, double convergenceMinimumValue=1e-6, unsigned int convergenceWindowSize=10, EstimateLearningRateType estimateLearningRate=Once, double maximumStepSizeInPhysicalUnits=0.0)
Gradient descent optimizer.
void SetOptimizerScalesFromPhysicalShift(unsigned int centralRegionRadius=5, double smallParameterVariation=0.01)
Estimating scales of transform parameters a step sizes, from the maximum voxel shift in physical spac...
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.
PixelIDValueEnum
Enumerated values of pixelIDs.