[Insight-users] Centered Affine Transform

Luis Ibanez luis.ibanez at kitware.com
Fri Jul 16 15:17:21 EDT 2004


Hi Lucas,

It is likely that you are misinterpreting
the encoding of the parameters in this
transform.

Please post the values of the parameters
that you are providing, and post also
what you are expecting to be the effect.

Note that you have:

     - Center of rotation
     - Translation
     - Offset
     - Rotation matrix


When you use this transform you should only
care about SetCenter(), SetTranlation() and
Rotation. Never touch the Offset directly.


A code snippet illustrating the calls that
you are making on the transform will also
be very useful....


  Thanks


    Luis


----------------------
Lucas Lorenzo wrote:

> Hi Gavin,
> 
> thanks a lot for your answer.
> 
> I'm setting the parameters using
> 
>     m_Transform->SetParameters(m_TransformParameters);
> 
> So, afterwards I'm adding
> 
>     m_Transform->ComputeOffset();
> 
> But still the results are not as expected (after rotation the object is  
> not been translated to the desired location). Is there anything wrong  
> in what I'm doing ?
> Thanks,
> 
> Lucas
> 
> On Jul 15, 2004, at 10:07 PM, Gavin Baker wrote:
> 
>>
>> 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
>> _______________________________________________
>> Insight-users mailing list
>> Insight-users at itk.org
>> http://www.itk.org/mailman/listinfo/insight-users
>>
> Lucas Lorenzo
> 
> University of Utah
> Nora Eccles Harrison CardioVascular Research and Training Institute
> Fellows Room
> 95 South 2000 East
> Salt Lake City, UT 84112-5000
> 
> e-mail:  lucas at cvrti.utah.edu
> telephone: 801-587-9536
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 





More information about the Insight-users mailing list