[Insight-users] difference between vector and covariantvector

Luis Ibanez luis.ibanez at kitware.com
Wed Jun 6 12:47:58 EDT 2007


Hi Jeroen,

     Thanks for your clarifications.


About your comments


0) Yes, an itk::Vector, is indeed a ContraVariantVector.
    We probably should point this out in the documentation.



1) I disagree with you that the definition of a Vectors as
    a relative position between two points only holds in
    flat Euclidean spaces. It actually holds in any flat
    space, not necessarily Euclidean. That is, the metric
    tensor does not have to be an identity matrix.



2) You are right in that the cross product is not strictly
    speaking a CovariantVector. Instead it is really a second
    rank tensor, that happens to have symmetric components that
    behave like a CovariantVector under Affine transformations.



3) I would like to see more details supporting your claim that
    the difference between two points, and the cross product of
    two vectors, transform differently under rigid rotations.
    I don't think that is the case.



4) The purpose of the comments in the documentation is not to
    indicate that some vectors are transformed and some are not.

    In practice the effect is that:

    itk::Vectors (read "ContravariantVector") are transformed
    under Affine Transform by multiplying the matrix of the
    transform, which represents rotations, shearing and scaling.

    itk::CovariantVectors, are transformed under Affine Transforms
    by multiplying with the *inverse* of the matrix.

    In the case of rigid rotations, the matrix is orthogonal and
    therefore it is equal to its inverse, so the effect is not
    noticeable.

    The difference between the behavior of CovariantVectors and
    Vectors (ContraVariantVectors) under Affine transformation
    can be noticed when scaling and/or shearing are involved in
    the transformation.




   Regards,


     Luis




=============
JSW wrote:
> Hi,
> 
> I must say that, apparently, ITK has a rather curious definition of 
> covariant vectors. First of all, a vector is either
> covariant or contravariant. Which one it is, depends on its 
> tranformation properties under coordinate changes.
> See: http://mathworld.wolfram.com/CovariantTensor.html
> 
> Formally the definition: Vector=Point1-Point2, is not even a vector, 
> that statement only holds in flat Euclidean
> space (and not on a sphere for example). The definition 
> CovariantVector=Vector1xVector2, also isn't a vector formally,
> but an axial vector (axial vectors do not change sign under inversion, 
> while vectors do).
> 
> A gradient is indeed a covariant vector (in fact, in differential 
> geometry it is the basis of all vector spaces). Note that if the space 
> is endowed with a metric, you can transform between contravariant and 
> covariant vectors easily.
> 
> I'm not objecting to the name "vector" for a difference of two points, 
> as long as we're in good old flat space, nothing
> bad will happen. However, the definition of a CovariantVector given 
> below, is misleading in my opinion. Here's why:
> Under rigid transformations (rotations for example), the difference 
> between two points transform covariantly. The
> cross-product of two vectors does not transform covariantly (at least 
> not as a vector, it does transform covariantly
> as a 2-form or anti-symmetric rank two tensor).
> 
> If the goal of the documentation is to express that there are certain 
> vectors that are transformed by ITK, and certain
> vectors that are not, then I would recommend using different names for 
> it (for example FixedVector and VariantVector).
> 
> best,
> Jeroen Wijnhout
> 
> Luis Ibanez wrote:
> 
>>
>> Hi Yannick,
>>
>> A Vector describes the relative position between two points in space.
>>
>>             Vector = Point1 - Point2
>>
>>
>> A CovariantVector describes the direction orthogonal to a surface.
>>
>>          CovariantVector = Vector1 x Vector2
>>
>> where "x" is a cross product of the two vectors.
>>
>>
>> CovariantVectors and Vectors behave differently under
>> Affine transformation. That is one of the reasons why
>> it is important to make a distinction between them in ITK.
>>
>>
>> For example:
>>
>>  Gradients of functions are CovariantVectors (not Vectors).
>>
>>
>>
>>    Regards,
>>
>>
>>
>>        Luis
>>
>>
>>
>> ----------------------
>> yannick pannier wrote:
>>
>>> Hi everybody,
>>>
>>> I'm learning how to use ITK's library and I don't understand very 
>>> well the difference between itk::CovariantVector and itk::Vector 
>>> classes.
>>>
>>> The ITK's software guide say :
>>>
>>> //  covariant vector differs from a vector in the way they behave
>>> //  under affine transforms, in particular under anisotropic
>>> //  scaling. If a covariant vector represents the gradient of a
>>> //  function, the transformed covariant vector will still be the valid
>>> //  gradient of the transformed function, a property which would not
>>> //  hold with a regular vector.
>>>
>>> Does anyone could give me more explanations ?
>>>
>>> Thanks,
>>>
>>> Yannick
>>>
>>>
>>> _______________________________________________
>>> Insight-users mailing list
>>> Insight-users at itk.org
>>> http://www.itk.org/mailman/listinfo/insight-users
>>>
>> _______________________________________________
>> Insight-users mailing list
>> Insight-users at itk.org
>> http://www.itk.org/mailman/listinfo/insight-users
>>
>>
> 
> _______________________________________________
> 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