[Insight-users] Centered Affine Transform

Luis Ibanez luis.ibanez at kitware.com
Sat Jul 17 14:15:14 EDT 2004


Hi Lucas,

Please post numbers  :-)

What are you using for rotation ?
What are the coordinates of the center of the object ?
What is the translation that you are applyng ?


TheCenteredAffineTransform transforms a point P into
a point P' by using the following expression


       P' =  R * ( P - C )   +   ( T + C )

In dimension N: C is a N dimensional point with
the coordinates of the center of rotation, P is
the N dimensional point to be transformed, P' is
the resulting N dimensional point, T is the N
dimensional translation Vector.


  Regards,



     Luis



----------------------
Lucas Lorenzo wrote:
> Hi Luis,
> 
> I'm selecting the spatial coordinates of the center of the object I'm 
> interested in.
> 
> Lucas
> 
> 
> On Jul 16, 2004, at 5:06 PM, Luis Ibanez wrote:
> 
>> Hi Lucas,
>>
>>
>> What center of rotation did you selected ?
>>
>>  Luis
>>
>>
>> ---------------------
>> Lucas Lorenzo wrote:
>>
>>> Hi Luis,
>>> I've been running some tests so as to understand a little bit better 
>>> what's this transform doing and it is clear to me now that it is 
>>> applying the translation first and then it is rotating the translated 
>>> image with respect to the specified center of rotation.
>>> My understanding is that it should perform these operations but in 
>>> reverse order.
>>> Please let me know if this is wrong.
>>> Thanks,
>>> Lucas
>>> On Jul 16, 2004, at 2:14 PM, Lucas Lorenzo wrote:
>>>
>>>> Hi Luis,
>>>>
>>>> thanks for your feedback.
>>>>
>>>> 1) Till now the way I was setting the parameters was using the 
>>>> m_Transform->SetParameters(m_TransformParameters);
>>>>
>>>> 2) I have a 2D image so my understanding is that I'm going to have 8 
>>>> parameters for this transformation where the first 4 parameters 
>>>> define the rotation, shear, and scaling; the next two define the 
>>>> center of rotation and the last two define the translation to be 
>>>> applied with respect to the center of rotation (after the image has 
>>>> been rotated).
>>>>
>>>> Please, let me know where am I making a mistake.
>>>>
>>>> Thanks,
>>>>
>>>> Lucas
>>>>
>>>>
>>>> On Jul 16, 2004, at 1:17 PM, Luis Ibanez wrote:
>>>>
>>>>>
>>>>> 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
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>> 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
>>>>
>>>>
>>> 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
>>
>>
>>
>>
>>
> 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