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

From NAMIC Wiki
Jump to: navigation, search
m (Update from Wiki)
m (Update from Wiki)
Line 1: Line 1:
Header for proposed itkSymmetricTensorTraits.
+
== ITK Data Structure for DT Images ==
  
<nowiki>
+
Since the itk::Image class is templated over pixel type and dimension, specifying a DT image is simply a matter of instantiating the image class over the appropriate tensor pixel type. However, there may be factors that we need to consider to make such an image practical.
/*=========================================================================
+
 
+
If we are focusing on 3D symmetric tensors, then each pixel at a minimum needs to store 6 floating point values to describe the tensor. To avoid calculating eigenvalues and eigenvectors multiple times for a given tensor during the course of an algorithm or pipeline of algorithms, there is a temptation to cache the eigenvalue and eigenvectors associated with a tensor. Processing DTI could quickly exhaust physical memory.
  Program:   Insight Segmentation & Registration Toolkit
+
 
  Module:   $RCSfile: itkSymmetricTensorTraits.h,v $
+
Some ideas to consider:
  Language:  C++
+
 
  Date:      $Date$
+
* Does every pixel in an DT image need to be stored? Are there pixels in the DT image that are outside the anatomical region of interest?
  Version:  $Revision$
+
** If so, the DT pixel should have minimum storage, perhaps just an internal pointer to the tensor data. That pointer could be null if the tensor for that pixel is not needed.
+
* Should the DT pixel be able to cache structure information (eigenvalues and eigenvectors)?
  Copyright (c) Insight Software Consortium. All rights reserved.
+
** The DT pixel could cache this information is the algorithm requested.
  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
+
** Tensor::ComputeEigenSystem(cache = true)
+
** Could have methods to destroy cached data
      This software is distributed WITHOUT ANY WARRANTY; without even
+
** Or should caching this type of information be left to the algorithm developer. An algorithm could separate data structures for caching eigenvalues and eigenvectors.
      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+
* Should the DT pixel type store FA and ADC?
      PURPOSE.  See the above copyright notices for more information.
 
 
=========================================================================*/
 
 
#ifndef __itkSymmetricTensorTraits_h
 
#define __itkSymmetricTensorTraits_h
 
 
#include "itkFixedArray.h"
 
 
namespace itk
 
{
 
/** \class itkSymmetricTensorTraits
 
  *
 
  */
 
template<typename TRealType, unsigned int VTensorDimension>
 
class ITK_EXPORT SymmetricTensorTraits
 
{
 
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>
 

Revision as of 14:06, 18 December 2006

Home < NAMIC Wiki:DTI:ITK

ITK Data Structure for DT Images

Since the itk::Image class is templated over pixel type and dimension, specifying a DT image is simply a matter of instantiating the image class over the appropriate tensor pixel type. However, there may be factors that we need to consider to make such an image practical.

If we are focusing on 3D symmetric tensors, then each pixel at a minimum needs to store 6 floating point values to describe the tensor. To avoid calculating eigenvalues and eigenvectors multiple times for a given tensor during the course of an algorithm or pipeline of algorithms, there is a temptation to cache the eigenvalue and eigenvectors associated with a tensor. Processing DTI could quickly exhaust physical memory.

Some ideas to consider:

  • Does every pixel in an DT image need to be stored? Are there pixels in the DT image that are outside the anatomical region of interest?
    • If so, the DT pixel should have minimum storage, perhaps just an internal pointer to the tensor data. That pointer could be null if the tensor for that pixel is not needed.
  • Should the DT pixel be able to cache structure information (eigenvalues and eigenvectors)?
    • The DT pixel could cache this information is the algorithm requested.
    • Tensor::ComputeEigenSystem(cache = true)
    • Could have methods to destroy cached data
    • Or should caching this type of information be left to the algorithm developer. An algorithm could separate data structures for caching eigenvalues and eigenvectors.
  • Should the DT pixel type store FA and ADC?