[Insight-developers] Centered Transforms

Stephen R. Aylward aylward at unc.edu
Mon Mar 7 13:15:00 EST 2005


When someone updates the center of rotation or matrix for a transform, 
either the translation or the offset must be implicitly updated for 
consistency.   This implicit update is necessary since translation and 
offset are related to one another via the transform matrix and the 
center of rotation.

My vote is that the offset should be implicitly updated when the center, 
matrix, or translation is set by the user; and that translation should 
only be implicitly updated when the offset is set by the user.

That is, we assume that most people will set the translation component 
and not the offset component - this assumption is consistent with the 
behaviour of our optimizers which use translation as a parameter during 
optimization, not offset.

As a result, the following code will be valid:

Using an Euler3DTransform called transform...

CenterType center;
center.Fill(10);

TranslationType translation;
translation.Fill(0);

transform.SetRotation( 1, 2, 3 );
transform.SetTranslation( translation );
transform.SetCenter( center );

OutputPointType transformedPoint = transform.TransformPoint( center );
if( transformedPoint[0] != center[0] )
   {
   itkWarningMacro(<< "Oops.  Transform of center is not the center");
   }

This is consistent with most of the current transforms.  Can we accept 
this as the general "rule" for itk?

The other options are to (2) update the offset implicitly when center or 
matrix are updated, or (3) require the user to explicitly call 
ComputeTranslation, ComputeMatrix, ComputeOffset, and 
ComputeMatrixParameters (which, for example, updates the versor in a 
versorTransform when the user sets the matrix directly).  Option 3 
requires significant changes throughout ITK.   Option 2 is okay, but 
will require a few changes - probably about the same number as 
implicitly updating transform - however, I see it as less consistent 
because of how optimizers update transforms....

Any opinions / comments?

Thanks,
Stephen

-- 
===========================================================
Dr. Stephen R. Aylward
Associate Professor of Radiology
Adjunct Associate Professor of Computer Science and Surgery
http://caddlab.rad.unc.edu
aylward at unc.edu
(919) 966-9695


More information about the Insight-developers mailing list