Difference between revisions of "Coordinate systems"

From Slicer Wiki
Jump to: navigation, search
(changed the introduction and added the other chapters)
Line 2: Line 2:
 
One of the great issues while dealing with medical images and applications are the differences between the coordinate systems. There are three coordinate systems commonly used in medical applications: a difference can be made between the '''world''', '''anatomical''' and the '''image coordinate system'''.
 
One of the great issues while dealing with medical images and applications are the differences between the coordinate systems. There are three coordinate systems commonly used in medical applications: a difference can be made between the '''world''', '''anatomical''' and the '''image coordinate system'''.
  
The following figure illustrates the three spaces with their corresponding axes:
+
The following figure illustrates the three spaces and their corresponding axes:
 
[[Image:coordinate_sytems.png| thumb | 550px | center | The 3 different spaces and their axes]]
 
[[Image:coordinate_sytems.png| thumb | 550px | center | The 3 different spaces and their axes]]
  
Each coordinate system serves one purpose and represents their data in different ways:
+
Each coordinate system serves one purpose and represents their data in different ways.
* The '''world coordinate system''' is typically a cartesian coordinate system in which a model (e.g. a MRI scanner or a patient) is positioned. Every model has its own coordinate system but there is only one world coordinate system to define the position and orientation of each model.
 
* The most important model coordinate system for medical imaging techniques is the '''anatomical space'''. This space consists of three planes to describe the standard anatomical position of a human:
 
** the ''axial plane'' is parallel to the ground and separates the head (Superior) from the feet (Inferior)
 
** the ''coronal plane'' is perpendicular to the ground and separates the front from (Anterior) the back (Posterior)
 
** the ''sagittal plane'' separates the Left from the Right
 
<span style="color:#FFFFFF">....</span> From these planes it follows that all axes have their notation in a positive direction (e.g. the negative Superior axis is represented by the Inferior axis).
 
* The '''image coordinate system''' describes how the images were acquired with respect to the anatomy. Medical scanners create regular, rectangular arrays of points and cells which start at the upper left corner. The ''i'' axis increases to the right, the ''j'' axis to the bottom and the ''k'' axis backwards.
 
  
=The relationship between the anatomical coordinate system and the image coordinate system=
+
==World coordinate system==
The '''anatomical coordinate system''' (also called patient coordinate system) is a continuous three-dimensional space in which an image has been sampled. In neuroimaging, it is common to define this space with respect to the human whose brain is being scanned. Hence the 3D basis is defined along the anatomical axes of anterior-posterior, inferior-superior, and left-right.
+
The world coordinate system is typically a Cartesian coordinate system in which a model (e.g. a MRI scanner or a patient) is positioned. Every model has its own coordinate system but there is only one world coordinate system to define the position and orientation of each model.
  
However different medical applications use different definitions of this 3D basis. Most common are the following:
+
==Anatomical coordinate system==
* LPS (Left, Posterior, Superior), which is used in DICOM images and by the ITK toolkit
+
The most important model coordinate system for medical imaging techniques is the anatomical space (also called patient coordinate system). This space consists of three planes to describe the standard anatomical position of a human:
* RAS (Right, Anterior, Superior) is similar to LPS with the first two axes flipped used in 3D Slicer
+
* the ''axial plane'' is parallel to the ground and separates the head (Superior) from the feet~(Inferior)
 +
* the ''coronal plane'' is perpendicular to the ground and separates the front from (Anterior) the back (Posterior)
 +
* the ''sagittal plane'' separates the Left from the Right
 +
From these planes it follows that all axes have their notation in a positive direction (e.g. the negative Superior axis is represented by the Inferior axis).
  
 +
The anatomical coordinate system is a continuous three-dimensional space in which an image has been sampled. In neuroimaging, it is common to define this space with respect to the human whose brain is being scanned. Hence the 3D basis is defined along the anatomical axes of anterior-posterior, inferior-superior, and left-right.
  
=3rdCaption=
+
However different medical applications use different definitions of this 3D basis. Most common are the following bases:
text
+
* LPS (Left, Posterior, Superior) is used in DICOM images and by the ITK toolkit
 +
<div style="text-align: center;">
 +
<math>  LPS = \begin{Bmatrix}
 +
                \text{from right towards left} \\
 +
                \text{from anterior towards posterior} \\
 +
                \text{from inferior towards superior}
 +
              \end{Bmatrix}
 +
</math>
 +
</div>
 +
* RAS (Right, Anterior, Superior) is similar to LPS with the first two axes flipped and used by 3D Slicer
 +
<div style="text-align: center;">
 +
<math>  RAS = \begin{Bmatrix}
 +
                \text{from left towards right} \\
 +
                \text{from posterior towards anterior} \\
 +
                \text{from inferior towards superior}
 +
              \end{Bmatrix}
 +
</math>
 +
</div>
 +
Both bases are equally useful and logical. It is just necessary to know to which basis an image is referenced.
 +
 
 +
==Image coordinate system==
 +
The image coordinate system describes how an image was acquired with respect to the anatomy. Medical scanners create regular, rectangular arrays of points and cells which start at the upper left corner. The ''i'' axis increases to the right, the ''j'' axis to the bottom and the ''k'' axis backwards.
 +
 
 +
In addition to the intensity value of each voxel ''(i j k)'' the origin and spacing of the anatomical coordinates are stored too.
 +
* The origin represents the position of the first voxel (0,0,0) in the anatomical coordinate system
 +
* The spacing specifies the distance between voxels along each axis
 +
The following 2D example shows the meaning of origin and spacing:
 +
 
 +
<span style="color:#FF0000"> '''TODO: Image with origin and spacing''' </span>
 +
 
 +
Using the origin and spacing, the corresponding position of each (image coordinate) voxel in anatomical coordinates can be calculated.
 +
 
 +
 
 +
=Image transformation=
 +
The transformation from an image space vector <math>(i\;j\;k)'</math> to an anatomical space vector <math>\vec{x}</math> is an affine transformation, consists of a linear transformation <math>A</math> followed by a translation <math>\vec{t}</math>.
 +
<div style="text-align: center;">
 +
<math>
 +
  \vec{x} = A \begin{pmatrix} i & j & k \end{pmatrix}' + \vec{t}
 +
</math>
 +
</div>
 +
 
 +
The transformation matrix <math>A</math> is a <math>3\,\times\,3</math> matrix and carries all information about space directions and axis scaling.
 +
 
 +
<math>\vec{t}</math> is a <math>3\,\times\,1</math> vector and contains information about the geometric position of the first voxel.
 +
<div style="text-align: center;">
 +
<math>
 +
  \begin{pmatrix} x_1 \\ x_2 \\ x_3 \end{pmatrix} =
 +
  \begin{pmatrix} A_{11} & A_{12} & A_{13} \\ A_{21} & A_{22} & A_{23} \\ A_{31} & A_{32} & A_{33} \end{pmatrix}
 +
  \begin{pmatrix} i \\ j \\ k \end{pmatrix} + \begin{pmatrix} t_1 \\ t_2 \\ t_3 \end{pmatrix}
 +
</math>
 +
</div>
 +
 
 +
The last Equation shows that the linear transformation is performed by a matrix multiplication and the translation by a vector addition. To represent both, the transformation and the translation, by a matrix multiplication an augmented matrix must be used. This technique requires that the matrix <math>A</math> is augmented with an extra row of zeros at the bottom, an extra column-the translation vector-to the right, and a '1' in the lower right corner. Additionally all vectors have to be written as homogeneous coordinates, which means that a '1' is augmented at the end.
 +
<div style="text-align: center;">
 +
<math>
 +
  \begin{pmatrix} x_1 \\ x_2 \\ x_3 \\ 1 \end{pmatrix} =
 +
  \begin{pmatrix} A_{11} & A_{12} & A_{13} & t_1 \\ A_{21} & A_{22} & A_{23} & t_2 \\
 +
                  A_{31} & A_{32} & A_{33} & t_3 \\ 0 & 0 & 0 & 1 \end{pmatrix}
 +
  \begin{pmatrix} i \\ j \\ k \\ 1 \end{pmatrix}
 +
</math>
 +
</div>
 +
 
 +
Depending on the used anatomical space (LPS or RAS) the <math>4\,\times\,4</math> matrix is called ''IJKtoLPS''- or ''IJKtoRAS''-matrix, because it represents the transformation from IJK to LPS or RAS.
 +
 
 +
=2D example or calculating an ''IJtoLS''-matrix=
 +
<span style="color:#FF0000"> '''TODO: Add the example of the session''' </span>

Revision as of 23:26, 12 April 2010

Home < Coordinate systems

Introduction

One of the great issues while dealing with medical images and applications are the differences between the coordinate systems. There are three coordinate systems commonly used in medical applications: a difference can be made between the world, anatomical and the image coordinate system.

The following figure illustrates the three spaces and their corresponding axes:

The 3 different spaces and their axes

Each coordinate system serves one purpose and represents their data in different ways.

World coordinate system

The world coordinate system is typically a Cartesian coordinate system in which a model (e.g. a MRI scanner or a patient) is positioned. Every model has its own coordinate system but there is only one world coordinate system to define the position and orientation of each model.

Anatomical coordinate system

The most important model coordinate system for medical imaging techniques is the anatomical space (also called patient coordinate system). This space consists of three planes to describe the standard anatomical position of a human:

  • the axial plane is parallel to the ground and separates the head (Superior) from the feet~(Inferior)
  • the coronal plane is perpendicular to the ground and separates the front from (Anterior) the back (Posterior)
  • the sagittal plane separates the Left from the Right

From these planes it follows that all axes have their notation in a positive direction (e.g. the negative Superior axis is represented by the Inferior axis).

The anatomical coordinate system is a continuous three-dimensional space in which an image has been sampled. In neuroimaging, it is common to define this space with respect to the human whose brain is being scanned. Hence the 3D basis is defined along the anatomical axes of anterior-posterior, inferior-superior, and left-right.

However different medical applications use different definitions of this 3D basis. Most common are the following bases:

  • LPS (Left, Posterior, Superior) is used in DICOM images and by the ITK toolkit

[math] LPS = \begin{Bmatrix} \text{from right towards left} \\ \text{from anterior towards posterior} \\ \text{from inferior towards superior} \end{Bmatrix} [/math]

  • RAS (Right, Anterior, Superior) is similar to LPS with the first two axes flipped and used by 3D Slicer

[math] RAS = \begin{Bmatrix} \text{from left towards right} \\ \text{from posterior towards anterior} \\ \text{from inferior towards superior} \end{Bmatrix} [/math]

Both bases are equally useful and logical. It is just necessary to know to which basis an image is referenced.

Image coordinate system

The image coordinate system describes how an image was acquired with respect to the anatomy. Medical scanners create regular, rectangular arrays of points and cells which start at the upper left corner. The i axis increases to the right, the j axis to the bottom and the k axis backwards.

In addition to the intensity value of each voxel (i j k) the origin and spacing of the anatomical coordinates are stored too.

  • The origin represents the position of the first voxel (0,0,0) in the anatomical coordinate system
  • The spacing specifies the distance between voxels along each axis

The following 2D example shows the meaning of origin and spacing:

TODO: Image with origin and spacing

Using the origin and spacing, the corresponding position of each (image coordinate) voxel in anatomical coordinates can be calculated.


Image transformation

The transformation from an image space vector [math](i\;j\;k)'[/math] to an anatomical space vector [math]\vec{x}[/math] is an affine transformation, consists of a linear transformation [math]A[/math] followed by a translation [math]\vec{t}[/math].

[math] \vec{x} = A \begin{pmatrix} i & j & k \end{pmatrix}' + \vec{t} [/math]

The transformation matrix [math]A[/math] is a [math]3\,\times\,3[/math] matrix and carries all information about space directions and axis scaling.

[math]\vec{t}[/math] is a [math]3\,\times\,1[/math] vector and contains information about the geometric position of the first voxel.

[math] \begin{pmatrix} x_1 \\ x_2 \\ x_3 \end{pmatrix} = \begin{pmatrix} A_{11} & A_{12} & A_{13} \\ A_{21} & A_{22} & A_{23} \\ A_{31} & A_{32} & A_{33} \end{pmatrix} \begin{pmatrix} i \\ j \\ k \end{pmatrix} + \begin{pmatrix} t_1 \\ t_2 \\ t_3 \end{pmatrix} [/math]

The last Equation shows that the linear transformation is performed by a matrix multiplication and the translation by a vector addition. To represent both, the transformation and the translation, by a matrix multiplication an augmented matrix must be used. This technique requires that the matrix [math]A[/math] is augmented with an extra row of zeros at the bottom, an extra column-the translation vector-to the right, and a '1' in the lower right corner. Additionally all vectors have to be written as homogeneous coordinates, which means that a '1' is augmented at the end.

[math] \begin{pmatrix} x_1 \\ x_2 \\ x_3 \\ 1 \end{pmatrix} = \begin{pmatrix} A_{11} & A_{12} & A_{13} & t_1 \\ A_{21} & A_{22} & A_{23} & t_2 \\ A_{31} & A_{32} & A_{33} & t_3 \\ 0 & 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} i \\ j \\ k \\ 1 \end{pmatrix} [/math]

Depending on the used anatomical space (LPS or RAS) the [math]4\,\times\,4[/math] matrix is called IJKtoLPS- or IJKtoRAS-matrix, because it represents the transformation from IJK to LPS or RAS.

2D example or calculating an IJtoLS-matrix

TODO: Add the example of the session