[ITK-users] [ITK] AffineTransform to 4x4 matrix...again maybe

vincent ngai vincent.ngai at gmail.com
Wed Aug 6 02:51:28 EDT 2014


Thanks Matt for the link.


On Wed, Aug 6, 2014 at 12:10 PM, Matt McCormick <matt.mccormick at kitware.com>
wrote:

> Hi Vincent,
>
> The values can also be used directly in the matrix as demonstrated here
> [1].
>
> HTH,
> Matt
>
> [1] https://gist.github.com/thewtex/8712205
>
> On Tue, Aug 5, 2014 at 10:08 PM, vincent ngai <vincent.ngai at gmail.com>
> wrote:
> > Hi Bradley,
> >
> > Hmm, GetCenter() negated should be the same as InvCRM. I'll flip the
> order
> > of the multiplication and see what happens, it could be the C++
> operator*()
> > order being different from the way its written. Its so annoying to get
> the
> > results close but not exact :(
> >
> > Thanks
> >
> >
> > On Tue, Aug 5, 2014 at 9:12 PM, Bradley Lowekamp <blowekamp at mail.nih.gov
> >
> > wrote:
> >>
> >> Hello,
> >>
> >> That looks pretty close, but I think CRM[12,13,14] should be
> -GetCenter(),
> >> with the negative there.  Then the TM should be applied last, using your
> >> original notation with the previously mentioned correction I'd expect
> this
> >> to be correct:
> >>
> >> OGLM = TM * InvCRM * Rot * CRM
> >>
> >> Hope that helps,
> >> Brad
> >>
> >> [1]
> >>
> http://www.itk.org/Doxygen/html/classitk_1_1MatrixOffsetTransformBase.html
> >>
> >> On Aug 5, 2014, at 5:26 AM, vincent ngai <vincent.ngai at gmail.com>
> wrote:
> >>
> >> > Hi all, apologies if this has been asked before, I googled the above
> but
> >> > only got 4x4 -> AffineTransform and not the other way around.
> >> >
> >> > I need to get the output of an AffineTransform after registration to
> my
> >> > OpenGL renderer.
> >> >
> >> > From what I understand, the AffineTransform is composed of a Rotation,
> >> > Center of Rotation and Translation.
> >> >
> >> > So would the following sequence of 4x4 transformation be correct?
> >> >
> >> > OGLM = InvCRM * Rot * CRM * TM
> >> >
> >> > where
> >> >
> >> > CRM      = 4x4 identity matrix with indices [ 12, 13, 14] set to XYZ
> >> > value of GetCenter()
> >> > InvCRM  = Inverse of CRM
> >> > Rot        = 4x4 Identity matrix with 3x3 set to the rotation
> parameters
> >> > TM        = 4x4 identity matrix with indicies[ 12, 13, 14 ] set to the
> >> > translation parameters
> >> >
> >> > Essentially:
> >> >
> >> > 1) translate center to origin
> >> > 2) perform rotation
> >> > 3) translate back to where we were
> >> > 4) slap on translation
> >> >
> >> > I am doing the above, but for some reason the translation does not
> match
> >> > up. The rotation seems fine.
> >> > --
> >> > Regards,
> >> > Vincent
> >> > _____________________________________
> >> > 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
> >>
> >
> >
> >
> > --
> > Regards,
> > Vincent
> >
> > _____________________________________
> > 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
> >
> > _______________________________________________
> > Community mailing list
> > Community at itk.org
> > http://public.kitware.com/mailman/listinfo/community
> >
>



-- 
Regards,
Vincent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20140806/da588d97/attachment.html>


More information about the Insight-users mailing list