[IGSTK-Developers] Bug in igstkTracker with calibration transform

Patrick Cheng cheng at isis.georgetown.edu
Tue Dec 20 11:32:29 EST 2005


Hi David and Julien,

As Ziv and I were trying to play with the calibration transform. We 
concluded that,  we should offer a simple matrix composition operator in 
the igstkTransform class. such as T' = T1*T2 and T' *= T1;

And current calculation of the transform (all in tracker class), may not 
be suitable for all purpose. for example, We need the tip position of 
the tracker tool for registration, we use the calibration transform. But 
when we trying to visualize it using our SpatialOject, we need the 
position with some offset to the tip (because our origin of the 
CylinderObject is in the center), to let cylinder in the scene over laid 
with the tracker tool, and here we can't use the calibration transform 
to do that, otherwise it mess up the registration part. UNLESS we 
redefine the origin of the spatialobject(maybe in the composite 
TrackerToolObject).

Patrick


Julien Jomier wrote:
> Hi David,
> 
> Thanks for the explanation. I think I understand the way it works and I 
> agree with the design but I think the implementation is wrong.
> Let me try to explain.
> 
>  From the documentation:
> 
>   T ' = P * R^-1 * T * C
> 
>   where:
>   " T " is the original tool transform reported by the device,
>   " R^-1 " is the inverse of the transform for the reference tool,
>   " P " is the Patient transform (it specifies the position of
>         the reference with respect to patient coordinates), and
>   " T ' " is the transformation that is reported to the spatial objects
>   " C " is the tool calibration transform.
> 
> So we are interested by this part of the equation here:
> 
> T*C = RotationT * (RotationC+TranslationC)+ TranslationT
> T*C = RotationT*RotationC + RotationT*TranslationC + TranslationT (1)
> 
> Looking at the code:
> 
> // start with ToolCalibrationTransform
> rotation = toolCalibrationTransform.GetRotation();
> translation = toolCalibrationTransform.GetTranslation();
> 
> // transform by the tracker's tool transform
> rotation *= transform.GetRotation();
> translation = transform.GetRotation().Transform(translation);
> translation += transform.GetTranslation();
> 
> Which can be written as:
> 
> T*C = RotationC*RotationT + RotationT*TranslationC + TranslationT (2)
> 
> Therefore, comparing (1) and (2) the rotation is computed in the wrong 
> order or maybe I'm missing something really obvisous...
> 
> And the m_PatientTransform is following the same implementation so might 
> be wrong as well.
> 
> Let me know what you think,
> 
> Julien
> 
> 
> David Gobbi wrote:
>> Hi Julien,
>>
>> I think that the tool calibration transform code is correct the way it 
>> is, but note that the
>> way the code is written, the tool calibration transform goes from the 
>> "calibrated tool"
>> coordinate system to the "raw tool" coordinate system.  This might be 
>> the opposite of
>> what you expect.
>>
>> There is a very good reason for having the calibration transform go in 
>> this direction.
>> You know how an igstkTransform defines a rotation followed by a 
>> translation? Since the tool tip is at (0,0,0) in the "calibrated" 
>> coord system, our "calibration transform"
>> applies a rotation about the tool tip, which is at (0,0,0) in the 
>> calibrated coord system,
>> followed by a translation to the "raw" tool tip location.
>>
>> This means that even if the rotation portion of the calibration 
>> transformation is incorrect,
>> the "tool tip" portion of the calibration will still give the correct 
>> tool tip location, since the
>> rotation part of the calibration occurs around the tool tip position.  
>> If the calibration
>> transform was the other way around, then we would not get this nice 
>> independence of
>> translation from rotation.
>>
>> If you already had your calibration transformation going in this 
>> direction, email me and I
>> will take a close look at the code to make sure that there is no bug.
>>
>> - David
>>
>>
>> Julien Jomier wrote:
>>
>>> Hello,
>>>
>>> There is an important bug in the igstkTracker class preventing any 
>>> calibration matrix to be applied correctly.
>>>
>>> The problem is in the UpdateStatusSuccessProcessing() function.
>>>
>>> The calibration transform should be applied first (rotation variable) 
>>> and then the transform from the tracker (transform variable).
>>> However the code is as follow:
>>>
>>> rotation *= transform.GetRotation();
>>>
>>> whis is in the wrong order and should be:
>>>
>>> rotation = transform.GetRotation()*rotation;
>>>
>>> Let me know if I should fix it, or if someone else is currently on 
>>> the igstkTracker class right now or if I'm missing something...
>>>
>>> Julien
>>> _______________________________________________
>>> IGSTK-Developers mailing list
>>> IGSTK-Developers at public.kitware.com
>>> http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-developers
>>>
>>
>>
>>
> _______________________________________________
> IGSTK-Developers mailing list
> IGSTK-Developers at public.kitware.com
> http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-developers
> 
> 



More information about the IGSTK-Developers mailing list