[ITK] [ITK-users] convert affine transform to scale versor 3D transform

Dženan Zukić dzenanz at gmail.com
Fri Mar 25 15:56:45 EDT 2016


Hi Emily,

the docs
<http://www.itk.org/Doxygen/html/classitk_1_1ScaleVersor3DTransform.html#a40d48115daec95ffa2bb52f273d2a1c3>
say that matrix set via SetMatrix is not checked for orthogonality. This is
probably the reason that you get runtime errors later.

To see how affine is properly transformed into scale versor, you might want
to take a look at BRAINSFit's code
<https://github.com/BRAINSia/BRAINSTools/blob/master/BRAINSCommonLib/BRAINSFitHelperTemplate.hxx>
to see how it is done there. The answer might not be in that file, but I
remember BRAINSFit had a conversion routine.

Regards,
Dženan

On Fri, Mar 25, 2016 at 3:26 PM, Hammond, Emily M <emily-hammond at uiowa.edu>
wrote:

> Hello,
>
>
> I am trying to read in an affine transform from a file and convert it to a
> scale versor 3D transform. To do this I wish to manually define the matrix
> in the versor transform and then manually define the translation. Thus far,
> I have run into some difficulties in manually setting the matrix. As far as
> I can tell it is as basic as this one line of code.
>
>
> affineTransform is of itk::AffineTransform< double >
>
> versorTransform is of itk::ScaleVersor3DTransform< double >
>
>
> versorTransform->SetMatrix( affineTransform->GetMatrix() );
>
>
> However, I am getting some runtime errors and I cannot figure out why.
> Both my versor transform and my affine transform are defined so I am not
> trying to access something that does not exist. Can anyone give me some
> insight as to why this member function may not work or if there is a better
> way to go about converting from affine to versor based transform?
>
>
> Thanks!
> Emily Hammond
>
> _____________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20160325/2858120f/attachment.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