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

From NAMIC Wiki
Jump to: navigation, search
m (Update from Wiki)
m (Update from Wiki)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
== ITK Data Structure for DT Images ==
+
This page host a discussion on the implementation details of a Tensor class.
  
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.
+
== Tensors and Traits ==
  
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.
+
Torsten Rohlfing for SRI International Neuroscience Program proposed the following for ITK tensor processing:
  
Some ideas to consider:
+
* 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.
 +
* [[NAMIC_Wiki:DTI:ITK-SymmetricTensorPixelType:Header|itkSymmetricTensor.h]]
 +
** Contains functions that do not benefit from knowledge of the tensor size, e.g., GetVnlMatrix()
 +
* [[NAMIC_Wiki:DTI:ITK-SymmetricTensorTraits::Header|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.
  
* 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?
+
=== A First version of the SymmetricSecondRankTensor class committed to ITK ===
** 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)?
+
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 DT pixel could cache this information is the algorithm requested.
+
 
** Tensor::ComputeEigenSystem(cache = true)
+
The class has been committed into ITK (May 2 2005) and it is expected to evolve in the CVS repository.
** 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.
+
=== A first version of SymmetricEigenAnalysis class committed to ITK ===
* Should the DT pixel type store FA and ADC?
+
 
 +
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.

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.