Difference between revisions of "NAMIC Wiki:DTI:ITK"

From NAMIC Wiki
Jump to: navigation, search
m (Update from Wiki)
m (Update from Wiki)
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
Header for proposed itkSymmetricTensorTraits.
+
This page host a discussion on the implementation details of a Tensor class.
  
<nowiki>
+
== Tensors and Traits ==
/*=========================================================================
+
 
+
Torsten Rohlfing for SRI International Neuroscience Program proposed the following for ITK tensor processing:
  Program:   Insight Segmentation & Registration Toolkit
+
 
  Module:    $RCSfile: itkSymmetricTensorTraits.h,v $
+
* Separate the operations which depend on the tensor size from those that do not.
  Language:  C++
+
** The former are in tensor traits, the latter are in tensor class.
  Date:      $Date$
+
* Filter classes operate on different tensor pixel type images (by templating).
  Version:  $Revision$
+
** The tensor classes can be more or less specialized. In particular, the filters will be able to support more general tensor classes that may be implemented later, as long as they provide the necessary interface functions for any given filter.
+
* [[NAMIC_Wiki:DTI:ITK-SymmetricTensorPixelType:Header|itkSymmetricTensor.h]]
  Copyright (c) Insight Software Consortium. All rights reserved.
+
** Contains functions that do not benefit from knowledge of the tensor size, e.g., GetVnlMatrix()
  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
+
* [[NAMIC_Wiki:DTI:ITK-SymmetricTensorTraits::Header|itkSymmetricTensorTraits.h]]
+
** Operations that depend on the tensor size, e.g., eigenvalue computation.
      This software is distributed WITHOUT ANY WARRANTY; without even
+
* itkTensorToFractionalAnisotropyImageFilter.{h,txx}
      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+
** Example filter that operates on tensor data.
      PURPOSE. See the above copyright notices for more information.
+
** Operates on any tensor class that implements T::ComputeEigenvalues()
+
* DiffusionTensorToFractionalAnisotropy.cxx
=========================================================================*/
+
** Example application. Reads a tensor image from a raw data file, computes the FA image, and writes the result.
+
 
#ifndef __itkSymmetricTensorTraits_h
+
=== A First version of the SymmetricSecondRankTensor class committed to ITK ===
#define __itkSymmetricTensorTraits_h
+
 
+
Given that Tensor can have any rank, from zero (scalar), one (vector), two (matrices) to N. It seemed appropriate to specify that this particular class was representing a symmetric tensor of second rank.
#include "itkFixedArray.h"
+
 
+
The class has been committed into ITK (May 2 2005) and it is expected to evolve in the CVS repository.
namespace itk
+
 
{
+
=== A first version of SymmetricEigenAnalysis class committed to ITK ===
/** \class itkSymmetricTensorTraits
+
 
  *
+
Serves as a thread safe alternative to vnl_symmetric_eigensystem, which calls netlib C routines is not thread safe. Please use this class in any multi-threaded filters.
  */
+
 
template<typename TRealType, unsigned int VTensorDimension>
+
=== A Hessian filter uses the Symmetric second rank tensor class ===
class ITK_EXPORT SymmetricTensorTraits
+
 
{
+
A filter for computing the Hessian of an image was also committed to ITK. This filter illustrates the first use of the SymmetricSecondRankTensor class as pixel type of an image.
public:
 
  static const unsigned int NTensorDimension = VTensorDimension;
 
  static const unsigned int NVectorDimension =
 
  VTensorDimension * (VTensorDimension+1) / 2;
 
 
  /** Standard class typedefs. */
 
  typedef SymmetricTensorTraits Self;
 
  typedef FixedArray<TRealType,NVectorDimension> SymmetricTensorBaseType;
 
 
  /// Perform eigenvalue computation.
 
  static void ComputeEigenvalues( const SymmetricTensorBaseType& tensor,
 
  double (&lambda)[VTensorDimension] );
 
};
 
 
/// Specialization for 3D tensors.
 
template<typename TRealType>
 
class ITK_EXPORT SymmetricTensorTraits<TRealType,3>
 
{
 
public:
 
  static const unsigned int NTensorDimension = 3;
 
  static const unsigned int NVectorDimension = 6;
 
 
  /** Standard class typedefs. */
 
  typedef SymmetricTensorTraits Self;
 
  typedef FixedArray<TRealType,NVectorDimension> SymmetricTensorBaseType;
 
 
  /// Perform eigenvalue computation.
 
  static void ComputeEigenvalues( const SymmetricTensorBaseType& tensor,
 
  double (&lambda)[3] );
 
};
 
 
} // end namespace itk
 
 
#ifndef ITK_MANUAL_INSTANTIATION
 
#include "itkSymmetricTensorTraits.txx"
 
#endif
 
 
#endif
 
 
</nowiki>
 

Latest revision as of 14:06, 18 December 2006

Home < NAMIC Wiki:DTI:ITK

This page host a discussion on the implementation details of a Tensor class.

Tensors and Traits

Torsten Rohlfing for SRI International Neuroscience Program proposed the following for ITK tensor processing:

  • Separate the operations which depend on the tensor size from those that do not.
    • The former are in tensor traits, the latter are in tensor class.
  • Filter classes operate on different tensor pixel type images (by templating).
    • The tensor classes can be more or less specialized. In particular, the filters will be able to support more general tensor classes that may be implemented later, as long as they provide the necessary interface functions for any given filter.
  • itkSymmetricTensor.h
    • Contains functions that do not benefit from knowledge of the tensor size, e.g., GetVnlMatrix()
  • itkSymmetricTensorTraits.h
    • Operations that depend on the tensor size, e.g., eigenvalue computation.
  • itkTensorToFractionalAnisotropyImageFilter.{h,txx}
    • Example filter that operates on tensor data.
    • Operates on any tensor class that implements T::ComputeEigenvalues()
  • DiffusionTensorToFractionalAnisotropy.cxx
    • Example application. Reads a tensor image from a raw data file, computes the FA image, and writes the result.

A First version of the SymmetricSecondRankTensor class committed to ITK

Given that Tensor can have any rank, from zero (scalar), one (vector), two (matrices) to N. It seemed appropriate to specify that this particular class was representing a symmetric tensor of second rank.

The class has been committed into ITK (May 2 2005) and it is expected to evolve in the CVS repository.

A first version of SymmetricEigenAnalysis class committed to ITK

Serves as a thread safe alternative to vnl_symmetric_eigensystem, which calls netlib C routines is not thread safe. Please use this class in any multi-threaded filters.

A Hessian filter uses the Symmetric second rank tensor class

A filter for computing the Hessian of an image was also committed to ITK. This filter illustrates the first use of the SymmetricSecondRankTensor class as pixel type of an image.