[Insight-developers] Members in itkSymmetricSecondRankTensor vs. itkDiffusionTensor3D

Luis Ibanez luis.ibanez at kitware.com
Sat Jun 4 14:07:35 EDT 2005


Hi Torsten,

Thanks for pointing this out.

You are right that these methods could be moved from the 
DiffusionTensor3D into the SymmetricSecondRankTensor.

Note however that the Diffusion tensor is explicitly limited
to 3D, so some of these operation can be optimized for
performance by counting in the 3D limitation. The Symmetric
second rank tensor, on the other hand, is N-Dimensional.


For example, the GetTrace() method is actually available
in both the SymmetricSecondRankTensor and the DiffusionTensor3D
classes. The implementation on the base class is N-Dimensional
and therefore slower because it involves a for-loop.  We could
speed it up by using template MetaProgramming, just as Bill
Lorensen did for the Oriented image....
The implementation on the derived class is the fastest possible
one because it goes straight to adding the three components in
the diagonal.


So, to summarize:
Yes, It makes sense to provide implementations of these methods
in the base class SymmetricSecondRankTensor, but for performance
reasons we definetily want to keep the specializations on the
derived class (DiffusionTensor3D). Specially taking into account
that this class is intended to be used as a Image Pixel Type.
Therefore these methods will be invoked millions of times in a
program using that uses the DTI image modality.


Regards,


    Luis


-------------------------
Torsten Rohlfing wrote:

> 
> Hi --
> 
> I have been playing with the recently added tensor data structures, and 
> I was wondering: wouldn't it make sense to move some of the member in 
> itkDiffusionTensor3D to itkSymmetricSecondRankTensor? I am talking in 
> particular about GetTrace(), GetFractionalAnisotropy(), 
> GetRelativeAnisotropy(). All these can easily be defined for an 
> arbitrary symmetric rank-2 tensor. The trace is even a general concept 
> that is not specific to DTI. I can see why one would think that the 
> anisotropy measures are connected to the idea of diffusion, but they can 
> easily be computed for non-diffusion related tensors, and maybe they'll 
> be useful there, too?
> 
> Best,
>  Torsten
> 





More information about the Insight-developers mailing list