[ITK] [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/community/attachments/20160718/6dc63931/attachment-0001.html>
-------------- next part --------------
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list