[Insight-users] ImageRegistration9.exe - 2DAffine

Luis Ibanez luis.ibanez at kitware.com
Tue Mar 16 16:07:01 EDT 2010


Hi Ganesh,

You captured most of the important changes.

However, for completeness we have just added to
ITK and example for performing 3D Affine registration.


You will find it under

     Insight/Examples/Registration/
                        ImageRegistration20.cxx


(and for your convenience the file is also attached
to this email).


You will run it as:

ImageRegistration20  fixedimage movingimage
  resampledimage  comparisonimagebefore
  comparisonimageafter     initialstep   iterations


This should now run in the Nightly Dashboard
as the test:

              ImageRegistration20Test


Please take a look at the code, give it a try,
and let us know if you have any questions,


      Thanks



           Luis




------------------------------------------------------------
On Thu, Mar 11, 2010 at 3:02 PM, Ganesh Narayanasamy
<nganesh76 at hotmail.com> wrote:
>
> I would like to make a 3D Affine image registration code, if there is none.
> I found a similar code in ImageRegistration9.cxx and would like to alter to
> make it applicable for 3D images. Are these the only changes needed or is
> there anything else that I need to make.
> After Line#529, I dont know if there is anything to change.
> Thanks,
> Ganesh
>
> ****
> Line 146:   const    unsigned int    Dimension = 3;
>
> Line 285 to 290: Need to remove lines 289, 290 and add 6 more lines to make
> a (4x3) matrix for 3D images.
>   optimizerScales[4] =  1.0;  optimizerScales[5] =  1.0;
>   optimizerScales[6] =  1.0;  optimizerScales[7] =  1.0;
>   optimizerScales[8] =  1.0;
>   optimizerScales[9] =  translationScale;
>   optimizerScales[10] =  translationScale;
>   optimizerScales[11] =  translationScale;
>
> After line 395, add
>   const double finalRotationCenterZ=transform->GetCenter()[2];
>
> After line 397, add
>   const double finalTranslationZ =finalParameters[6];
>
> After line 408, add
>   std::cout << " Center Z      = " << finalRotationCenterZ  << std::endl;
>
> After line 410, add
>   std::cout << " Translation Z = " << finalTranslationZ  << std::endl;
>
> Change line 418 into
>   vnl_matrix<double> p(3, 3);
>
> After line 420 add
>   p[0][2] = (double) finalParameters[2];  p[1][0] = (double)
> finalParameters[3];  p[1][1] = (double) finalParameters[4];
>   p[1][2] = (double) finalParameters[5];  p[2][0] = (double)
> finalParameters[6];  p[2][1] = (double) finalParameters[7];
>   p[2][2] = (double) finalParameters[8];
>
>
> Change line 425 into
>   vnl_matrix<double> r(3, 3);
>
> Add after line 432
>   std::cout << " Scale 3        = " << svd.W(2)<< std::endl;
>
>
> ***
>
>
>
>
> ________________________________
> Hotmail: Trusted email with Microsoft’s powerful SPAM protection. Sign up
> now.
> _____________________________________
> 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.html
>
> 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://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ImageRegistration20.cxx
Type: text/x-c++src
Size: 16132 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100316/3929e574/attachment-0001.cxx>


More information about the Insight-users mailing list