Difference between revisions of "Proposals:Oriented Image Registration"

From KitwarePublic
Jump to navigationJump to search
Line 66: Line 66:


== Adding a CMake Flag for preserving backward-compatibility ==
== Adding a CMake Flag for preserving backward-compatibility ==
The CMake advance variable
    ITK_USE_ORIENTED_IMAGE_DIRECTION
has been added to the files
* Insight/CMakeLists.txt
* Insight/itkConfigure.h.in
In this way, the symbol is now available to be used in #define statements in the code.

Revision as of 13:20, 3 October 2007

Proposal

itkOrientedImage should be the preferred image to use for performing image registration.

Currently the direction cosines contained in this image are not used consistently by all the classes involved in image registration.

This page proposes a comprehensive approach for fixing this problem.

The Problem

Most image metrics internally compute image gradients as part of the process of computing the derivatives of the Metric. Such image gradients are currently computed in the space of the image grid, taking into account the pixel spacing but not taking into account the image direction

This issue has been logged as Bug Entry: 5081

http://public.kitware.com/Bug/view.php?id=5081

and has been discussed multiple times in the developers list (citation needed)

The Proposed Solution

The prososed solution involves modifications of the toolkit at four different levels

  1. Adding a methods to itk::ImageBase for transforming index space Gradients into physical space Gradients and back
    • These methods will be overloaded in the oriented image.
    • The methods will be implemented using Template Metaprogramming in order to reduce their impact on performance
  2. Adding boolean flags to all classes that compute image gradients
    • When the boolean flags are ON the image direction will be taken into account
    • The boolean flags will be initialized to OFF by default in order to provide backward-compatibility
  3. The ImageMetrics will turn ON the boolean flags of helper classes used for computing gradients
  4. An advanced CMake variable will enable the use of all the mechanisms defined above
    • The variable will be OFF by default in order to provide backward-compatibility

Details on each one of these items follow

Adding Gradient Transformation Methods to the itk::ImageBase

Following the naming of the existing methods

  • TransformIndexToPhysicalPoint
  • TransformPhysicalPointToIndex

we propose to add the methods

  • TransformIndexToPhysicalGradient
  • TransformPhysicalGradientToIndex

or we could be more specific and say "IndexGradient"

  • TransformIndexGradientToPhysicalGradient
  • TransformPhysicalGradientToIndexGradient

to avoid the ambiguity of whether we are actually transforming indices into gradients, or transforming gradients that were computed in index space into gradient that are computed in physical space.

Note that strictly speaking, currently the gradients are not computed in index space, but in a space that takes the spacing but not the direction into account. This is not quite index space, but it is not physical space either.

We could acknowledge that fact and use a naming such as one of the following

  • ApplyDirectionToGradient
  • RotateGradientsByDirectionCosines

Adding Boolean flags to Image Gradient computation classes

Turning on boolean flags from Image Metrics

Adding a CMake Flag for preserving backward-compatibility

The CMake advance variable

   ITK_USE_ORIENTED_IMAGE_DIRECTION

has been added to the files

  • Insight/CMakeLists.txt
  • Insight/itkConfigure.h.in

In this way, the symbol is now available to be used in #define statements in the code.