[Insight-users] Centered Affine Transform
Gavin Baker
gavinb+xtk at cs.mu.OZ.AU
Fri Jul 16 00:07:10 EDT 2004
Hi Lucas,
On Thu, Jul 15, 2004 at 06:01:26PM -0600, Lucas Lorenzo wrote:
> I'm trying to use a Centered Affine Transform. So first I'm taking a
> look at the following example:
>
> Examples/Registration/ImageRegistration9.cxx.
>
> I'm a little bit confused on how to use the ComputeOffset() method
> because I don't see where it is been used in this example and when
> reading the online documentation my understanding is that it is
> mandatory to use this particular method.
>
> Could anyone please help me to get a better understanding on this issue
> ?
When using the centered affine transform, there is an implicit translation
due to the center. The offset takes into account the affect of any
rotations you specify on this center, to give a new translation. The
ComputeOffset() method recalcuates this offset (which need only be done
once), and needs to be updated before applying the transform.
This was discussed a while ago:
http://public.kitware.com/pipermail/insight-users/2003-October/005230.html
http://public.kitware.com/pipermail/insight-users/2003-October/005272.html
>From the comments at the top of ImageRegistration9.cxx (from the Software
Guide) show:
// Note that the final total offset of the transform
// is to be computed as a combination of the shift due rotation plus the
// explicit translation set on the transform.
//
General usage would be:
xform->Translate( delta );
xform->Rotate( theta );
// ...
xform->ComputeOffset();
resample->Update();
ComputeOffset() is actually called explicitly in all the
CenteredAffineTransform methods that affect the transform, but (obviously)
not any AffineTransform methods. It isn't called automagically (after each
change) since it only needs to be done once, although it probably wouldn't
hurt if it were.
:: Gavin
--
Gavin Baker Complex Systems Group
http://www.cs.mu.oz.au/~gavinb The University of Melbourne
More information about the Insight-users
mailing list