[Insight-developers] ICE VS 6.0 : Adding SymmetricSecondRankTensor interactions with Matrix & Transform classes

Luis Ibanez luis.ibanez at kitware.com
Mon Mar 10 13:56:26 EDT 2008


Hi Steve,


                  You bring up a very good point.


Let me clarify the practical motivation for adding these methods,
and with that in mind we can revisit what is the appropriate way of
implementing the product of a matrix and a SymmetricSecondRankTensor.



Motivation:

   ITK added support for DTI (diffusion tensor images)
   a couple of years ago.  Life was good, until several
   DTI users realized that the coordinate system in which
   the gradients of an image are represented, do not
   necessarily match the coordinate system of the image
   itself (e.g. the orientation defined by the DICOM header).

   They therefore identified the need for transforming the
   coordinate system of the Tensors that result are computed
   from the several gradient images that are part of a DTI
   image acquisition.

   Tensors (just as vectors) are invariant to translations
   in space, they are only subject to rotations and to
   shearing and scaling transformations.

   To summarize: We need to apply the rotation/shearing/
   scaling component of Affine transforms to Tensors.


Math:

   These Transformations described above can be represented
   as Matrices (e.g. the typical 3x3 matrix in 3D).

   The standard way of applying transformations to Tensors
   is to pre-multiply the Tensor by the Matrix and to
   post-multiply the Tensor by the inverse of the Matrix


                  T'   =   M * T * M^-1


Implementation:


   We started by providing a Matrix by Tensor multiplication
   in order to have an easy way of computing ( M * T )

   Then we plan to modify the Transform by adding a method
   TransformSymmetricSecondRankTensor() that internally
   with use the Matrix of a transform for computing the
   operation:

                  T'   =   M * T * M^-1

    This will be the implementation for all Transforms
    deriving from the MatrixOffsetTransformBase class.

    Note that other Transforms may not have a good
    definition of how to transform a second rank Tensor.

    E.g. A BSplineDeformableTransform or a KernelTransform
    will not implement the method above.



Note that in the implementation of ITK, Tensors do not have
an explicit concept of having covariant and contravariant
indices. If we were more formal, we would have to make that
distinction, and then the operations above will have to
be modified according to which indices of the tensor are
covariant and which ones are contra-variant.



Please let us know if you find any flaws in the concepts
or in the implementation plans.


We look forward to your suggestions on how to implement
this functionality in a better way.


     Thanks


        Luis


----------------------
Steve M. Robbins wrote:
> On Mon, Mar 10, 2008 at 09:10:51AM -0400, Luis Ibanez wrote:
> 
> 
>>In this process we added yesterday a method for operator*() between a
>>Matrix and a SymmetricSecondRankTensor.
> 
> 
> Not having looked at the source, my natural assumption is that a
> multiplication operation defined between a matrix and a second rank
> tensor would treat the matrix as a second rank tensor.  Then I have to
> wonder: what kind of multiplication is intended?  A tensor product
> producing a rank 4 tensor?  Or some kind of contraction?  If so,
> between which indices?  Or maybe it is the tensor being treated as a
> matrix, and matrix multiplication in intended?
> 
> Now that I've looked at the code, I can see it is the latter.  I'm
> exaggerating to make a point, but if there is not an unambiguous
> natural meaning to "multiplication", perhaps it's worth reconsidering
> the operator overload.
> 
> -Steve
> 
> P.S.  Reasonable people even disagree as to whether a matrix has a
> "natural" multiplication;
> c.f. http://lists.boost.org/Archives/boost/2007/12/131388.php


More information about the Insight-developers mailing list