Referentials and transformations in Anatomist

General definition

A referential stands for a coordinates system and can be allocated to an object. So an object can moved from its referential to another if it exists a transformation between the two referentials. This transformation enables to change the corrdinates.

A referential can be allocated to an object or to a window. A transformation between two objects enables to align one object with the other. Whereas a transformation between an object and a window changes the point of view for visualizing the object.

Transformations' format

Anatomist manages affine transformations : translation, rotation, zoom. It uses .trm format, created for Anatomist. It is an ascci file, so it can be opened and modified with any text editor. It contains a 3x3 matrix and a translation vector.

Figure 8.2. Example of a transformation .trm file

Example of a transformation .trm file

This means :

Tx Ty Tz

Rxx Rxy Rxz

Ryx Ryy Ryz

Rzx Rzy Rzz

This format defines a translation T and a rotation matrix R. Ce format spécifie une translation T et une matrice de rotation R. Let R1 the refenential of a first volume and R2 the referential of a second volume. The file R1_TO_R2 gives a transformation that moves from R1 to R2. So we have the following relation between coordinates of the two referentials : X2 = R * X1 + T.

The name of transformation file is generally *TO*.trm where each * is a referential. For example : refimage_TO_Talairach.trm. These transformations apply between two referentials and modifies only display of corresponding objects. Data on disk is not modified.

Referential of an object

Definition

Each object has an associated referential. Referentials are useful to compare objects. Without referentials each objects would be in its own coordinates system (sampling of the real world according to volume dimensions and voxels size) and objects coming from different modalities or acquisition wouldn't be comparable. With identified referentials and transformations to move from one to another, it is possible to put objects in the same referentials in order to superimpose or merge them in a consistent way.

Why and how changing the referential of an object ?

Why :

  • Put an object in a new referential and load a transformation to another object in order to compare the two objects. For example, you have registered an fMRI to a T1 MRI and obtained a transformation file. You can use this transformation to visualize the two original images in a consistent way : put each object in a referential and load the transformation from fMRI referential to T1 MRI referential.

  • Put a new object (o1) in the referential of another object (o2) which has already a transformation to the referential of a third object. In this case o1 and o2 are supposed to be in the same coordinate system. For example, o1 can be a mesh obtained from the anatomy o2.

How : Click on the object and select Referential => Load And then choose an existing referential or create a new one if needed.

Referential of a window

Definition

Each window is associated to a referential. This referential is used to visualize objects. If the referential of the window is different from the referential of the containing objects, it can change the point of view if there is a transformation between the two referentials.

Why and how changing the referential of a window ?

Why : For example to see several anatomical MRI in the same referential, Talairach-AC/PC-Anatomist based on AC and PC points defined in the process Prepare subject of BrainVISA.

How :

  • Click on the colored bar indicating the referential. See the figure below :

    Figure 8.3. Modifying the referential of a window (1)

    Modifying the referential of a window (1)
  • A new window opens and you can create a new referential or choose an existing one :

    Figure 8.4. Modifying the referential of a window (2)

    Modifying the referential of a window (2)

Loading a transformation between two referentials

To load a transformation between two referentials :

  • Select the menu Settings => Referential window.

  • A new window opens showing existing referentials (colored points) and transformations (arrows) between them. To load a new transformation, you need at least 2 referentials.

  • To load the transformation, draw a line with the mouse from one referential to the other (take care of the direction). Then a file dialog opens and you select the transformation file.

  • Windows and objects associated to these referentials are updated.

Actions on transformations : delete, save...

The transformation menu is available by right click on the arrow representing the transformation (in the window Settings => Referential window). Here is this menu :

  • Delete transformation : deletes the transformation between the two referentials.

  • Invert transformation : inverts the direction of the transformation.

  • Reload transformation : enables to change the transformation information by choosing a .trm file.

  • Save transformation : saves the transformation in a file. Used in transformation control (manual registration).

Application : loading a transformation (coming from registration) between an anatomical volume and a functional volume.

For example, we want to visualize an antomical image (anat.img) and a functional image (fonc.img). We need to align the volumes using a transformation matrix (previously computed anatTOfonc.trm). Each volume has its own coordinates system.

STEP 1 : Load volumes, set a new referential for fonc.img and create a linear fusion between anat.img and fonc.img.

STEP 2 : Select the menu Settings => Referential window.

STEP 3 : Then you see the referentials window.

STEP 4 : Draw a line with the mouse from one referential to the other according to the direction of the transformation. A file dialog will open.

STEP 5 : We can see that there is a now transformation between the two referentials and that the fusion display is updated.

Figure 8.5. Loading a transformation between an anatomical volume and a functional volume.


To replay the movie, right-click on the movie to display the Adobe Flash Player menu. Run back then play again the movie.

How to get a transformation file ?

There are several ways to get a .trm file :

  • Using Aims commands to register 2 volumes (AimsMIRegister and AimsManualRegistration).

  • Using Anatomist transformation control in order to do a manual registration.

  • Convert .mat files into .trm files with BrainVISA processes : fMRI => converters => SPM to AIMS transformation converter and fMRI => converters => SPM sn3d to AIMS transformation converter. These processes need a Matlab licence. Only affine part of the transformation is converted.

  • You can write your own transformation file.

Manual registration using Anatomist transformation control

Example : manual registrationbetween a functional volume (Vf) and an anatomical volume (Va)

  1. Load the volumes Va and Vf.

  2. Fusion the 2 volumes to see how their relative position.

  3. Put the volume that have to be moved, Vf, in a window.

  4. Select Vf in the window : - Right click on the window - Choose View / select objects - select Vf in the browser window.

  5. In the window containing Vf, click on the transformation control.

  6. You can move Vf in its window using the keyboard shortcuts.

    NB : When you move Vf, a new referential is assigned to it. Indeed, Vf and Va are in two different referentials, and the transformation between these referentials is being computed.

    NB : While you are moving Vf and Va, don't forget to look at all views : axial, coronal and sagittal.

  7. Save the transformation :

    - Settings -> Referential window

    - The referential window opens. Each referential is represented by a colored round.

    - Find the arrow betwenn Va and Vf referentials

    - Right click on it and choose Save transformation

    - Generally, the name is something like *TO*.trm, for example VfTOVa.trm

  8. Edit the .trm file with a simple text editor to see the parameters of the transformation.

Using transformation information contained in SPM/NIFTI headers

SPM and NIFTI formats can put informations about referentials and transformations in the header file.This information can be found in attributes spm_origin, referentials, transformations. It deals with referentials used in SPM. It can be useful to load these referentials and transformations when you have several images which are aligned in one of these referentials.

The Anatomist feature Load information from file header (in object menu -> referential) loads the referentials and transformations mentionned in the header. If there is no transformation information, the feature does nothing. You can see the new referentials and transformations in the referentials window (in settings menu). The referential assigned to the object also changes. But by default, the display doesn't changes. Indeed, default window's referential is Talairach AC/PC Anatomist and there's generally no link between this referential and the referential of the object. If there is a transformation between object's referential and another referential and you change the window's referential to this destination referential, the display will change.

If you set the user level to Expert, you can see another transformation when using Load information from file header: the transformation between the referential of the data on disk and the referential of the loaded object. This information is in storage_to_memory attribute.