[IGSTK-Developers] Re: itkPivotCallibration

Luis Ibanez luis.ibanez at kitware.com
Thu Dec 8 14:50:20 EST 2005


   Hi James,


   Depending on what operations you to perform in
   the container, you could use


     A) std::vector<> of itk::Versors
        std::vector<> of itk::Vectors

   or

     B) itk::VectorContainer<> of itk::Versors
        itk::VectorContainer<> of itk::Vectors



   Also, you don't need to use vnl_vectors. All vector operations
   are implemented in itk::Vector. The vnl_matrix can probably be
   avoided too. We try to stay away from VNL because it breaks the
   API of ITK.


   It will be safer to avoid passing Quaternions as 4 elements.
   A Quaternion can represent rotations *and scaling*. Only unit
   quaternions should be used for pure rotations. That's the reason
   why we use Versors in ITK, since a Versor is a unit Quaternion,
   and guarrantees to stay that way.

   The code of the PivotCallibration class could be greatly simplified
   if you use the ITK Vector and Versor classes.


   Please let me know if you find problems converting this class
   to use ITK elements.


      Thanks


         Luis



----------------
Hui Zhang wrote:
> Hi, Luis,
> 
> I use std::vector<double> as the container for the samples of 
> translation and rotation.
> 
>  typedef std::vector< double >           InputContainerType;
> .....
>  /** Container to save the samples */
>  InputContainerType    m_Quaternion[4];
>  InputContainerType    m_Translation[3];
> 
> That typedef std::vector< double > is only for the one element of 
> Quaternion or Vector, so that there have four containers for Quaternion 
> and three containers for Vector. My orginal code only makes use of VNL, 
> and is not from ITK layer, so I use STL instead. I know that ITK has 
> Versor and Vector type, but I am not sure whether ITK provides the 
> container for them, eg, an array of Versors or Vectors and the size can 
> be dynamically changed. If ITK has them, I can definitely try to change 
> this from STL to ITK.
> 
> Thanks,
> James
> 
> ----- Original Message ----- From: "Luis Ibanez" <luis.ibanez at kitware.com>
> To: "Hui Zhang" <zhang at isis.imac.georgetown.edu>
> Cc: "David Gobbi" <dgobbi at atamai.com>; "IGSTK Developers" 
> <igstk-developers at public.kitware.com>
> Sent: Thursday, December 08, 2005 2:03 PM
> Subject: itkPivotCallibration
> 
> 
>>
>> Hi James,
>>
>> I'm looking at the PivotCallibration class and was
>> wondering why you are using std::vector<double>
>> for representing Quaternions and Vectors.
>>
>> ITK already provide you with Vectors and Versor
>> classes that you could use here.
>>
>> Is there any particular reason why you decided to
>> use the std::vector<>  instead of ITK classes ?
>>
>>
>>  Please let me know,
>>
>>
>>      Thanks
>>
>>
>>        Luis
>>
>>
>>
>>
> 
> 
> 
> 




More information about the IGSTK-Developers mailing list