[ITK-users] simpleITK C# bspline registation
Anton Delehony
anton.delehony at gmail.com
Mon Jul 18 17:06:54 EDT 2016
Hi all,
I noticed that the output of my registration is exactly as the moving
image, which means that the code below is not correct, but not sure where
is the mistake. I think it has to do with the transform initializer....
Thanks,
AD
// Read input static
itk.simple.ImageFileReader reader1 = new
itk.simple.ImageFileReader();
reader1.SetFileName(args[0]);
Image static = reader1.Execute();
// Read input moving
itk.simple.ImageFileReader reader2 = new
itk.simple.ImageFileReader();
reader2.SetFileName(args[0]);
Image moving = reader2.Execute();
//registation
itk.simple.ImageRegistrationMethod R = new
itk.simple.ImageRegistrationMethod();
R.SetMetricAsMattesMutualInformation(50);
R.SetMetricSamplingPercentage(30.0);
R.SetInterpolator(itk.simple.InterpolatorEnum.sitkLinear);
R.SetOptimizerAsLBFGSB();
itk.simple.BSplineTransform transform = new
itk.simple.BSplineTransform(3);
R.SetInitialTransform( transform);
itk.simple.Transform trans_f = R.Execute(static, moving);
//resample image
itk.simple.ResampleImageFilter resample = new
itk.simple.ResampleImageFilter();
resample.SetReferenceImage(static);
resample.SetTransform(trans_f);
resample.SetInterpolator(itk.simple.InterpolatorEnum.sitkBSpline);
itk.simple.Image registered = resample.Execute(moving);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20160718/6dc63931/attachment.html>
More information about the Insight-users
mailing list