Differences between revisions 14 and 15
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
FreeSurfer uses some of the tools developed at the Montreal Neurological Institute (MNI) (http://www.bic.mni.mcgill.ca) to align anatomical volumes (using minctracc) and to compute the linear Talairach transform (using mritotal). The mritotal documentation says that it generally works well for T1 dominant images. The transform is contained in a 3x4 matrix in a file called talairach.xfm and is located in the <subject name>/mri/transforms directory.

The mritotal program uses correlation as a similarity measure, and can fail due to image artifacts that reduce the correlation of a good match. Some examples of these are caused by the volume having systematic gray scale variations, noisy white matter regions, or a bright neck region.
FreeSurfer compute a linear Talairach transform contained in a 3x4 matrix in a file called talairach.xfm and is located in the <subject name>/mri/transforms directory. Under some circumstances, the alignment can fail the automatic failure detection scheme.

[wiki:FsTutorial top] | [wiki:FsTutorial/TroubleshootingData previous]

Fixing Bad Output From the Talairach Registration

  • To follow this exercise exactly be sure you've downloaded the [wiki:FsTutorial/Data tutorial data set] before you begin. If you choose not to download the data set you can follow these instructions on your own data, but you will have to substitute your own specific paths and subject names.

FreeSurfer compute a linear Talairach transform contained in a 3x4 matrix in a file called talairach.xfm and is located in the <subject name>/mri/transforms directory. Under some circumstances, the alignment can fail the automatic failure detection scheme.

The best way to check the transform is by loading it visually. This can be done directly from tkmedit (File --> Load Transform), however new users sometimes feel more comfortable viewing the transform in tkregister2, where it is possible to view the transform on top of the talairach subject. When viewing in tkmedit you can expect some distortion and stretching from the position of your subject - especially a sagittal tilt, but you want to avoid any changes in orientation (i.e., the coronal view of your subject should be the coronal view of your talairach transform), severe changes in positioning in the window (i.e., your transformation should not show up in the top left corner of the view, while your subject is nicely centered), and rotations or twisting. If any of these are seen, you will need to correct your transform.

Subject 5 is an example of a bad talairach. The surface cutting planes are far off center but the problem actually originates from the bad talairach transform. To view this talairach in tkmedit first be sure you have the subject open:

tkmedit subject5_before brainmask.mgz

If the surfaces are also loaded into tkmedit you may find it easier if you toggle them off for this part.

In the tkmedit toolbar, go to File -> Transforms -> Load Transform for Main Volume... Click browse, select the file talairach.xfm and click 'OK'. In the coronal view, the transform has resulted in an extremely distorted brain.

attachment:subject5_talairach3.jpg

To further view and edit this transform we will use tkregister2. To open this you can close the tkmedit window and open tkregister2 with the command:

tkregister2 --mgz --s subject5_before --fstal --surf orig

Note: If your subject surfaces are not yet available, then exclude the --surf orig flag from tkregister2.

Brief descriptions on how to operate tkregister2 are given below. More documentation is also available by running "tkregister2 --help".

You will see the subject's volume as the TARGET volume and your Talairach volume as a fuzzy MOVEABLE volume. The green lines are the orig surface from the subject. This will be the same in both the TARGET and the MOVEABLE. It can be turned on and off by clicking in the image window and hitting the 's' key.. Find the fmov: box in the tkregister toolbar and make sure it is set to 1.0.

The goal is to stretch, translate, and rotate your MOVEABLE volume so that the two brains look as similar as possible, at least along the key anatomical points (anterior/posterior commissures, the temporal lobes in the coronal plane, and the midline cut).

Use Ctrl-1 and Ctrl-2 to switch between the two volumes (or hit the COMPARE button). You will want to do this frequently to check your progress. Click the SAGITTAL button to switch to a sagittal view, and go to slice 128 by using the slider directly below the SAGITTAL button. In this view you have a good view of the corpus callosum in both the moveable and target volumes.

attachment:tal0.jpg

To rotate the moveable volume, use the ROTATE BRAIN slider. You will want to move the slider only a couple of degrees at a time until you achieve the desired effect. You will notice a small red cross icon near the middle of the viewing window. This is the center of rotation. You can change the location of the center of rotation by left-clicking in the viewing window with your mouse.

attachment:tal1.jpg

For translation, there are two sliders: one to move the volume left and right, and one to move the volume up and down. Next, translate the moveable brain upwards by using the TRANSLATE BRAIN vertical slider. Again, you only want to move the volume a couple millimeters at a time. You can move the volume left and right in the same way.

attachment:tal2.jpg

Once you have the corpus callosum aligned as well as possible in the sagittal plane, click the HORIZONTAL button to get a horizontal view, and use the slider directly below the HORIZONTAL button to go to slice 128. Use Ctrl-1 and Ctrl-2 to switch between the two volumes. Use the ROTATE BRAIN and TRANSLATE BRAIN buttons as before to align the midlines of both volumes.

attachment:tal3.jpg

Once you are done aligning the brains in the horizontal view, switch back to slice 128 in the sagittal view. Fine tune your rotation and translation again until the corpus callosum is once again aligned in both volumes.

attachment:tal4.jpg

Click the CORONAL button, and go to slice 128. Align the midlines of the brains again in the same way.

attachment:tal5.jpg

Continue this way, switching frequently between the HORIZONTAL, SAGITTAL, and CORONAL views, and align the visible brain structures as much as possible in all of the slices. Use the SCALE BRAIN button as needed to scale the brain in the X and Y direction. Keep in mind that you are working in 3D, not in 2D, so any changes made in one view will affect the other views as well.

attachment:talcor.jpg attachment:talsag.jpg attachment:talhor.jpg

When you are satisfied with your registration result, click the SAVE REG button in the tkregister2 toolbar. You can close tkregister2 by clicking on the red close button in the upper left hand corner of the viewing window, or by typing Ctrl-C in in the same terminal window as the new matrix.

Because the talairach transformation affects everything in the stream it is necessary to rerun the whole process using your new talairach, which is a default. You can do this with the command:

recon-all -all -subjid subject5_before

This step will take a long time to run, it is not necessary to run this step for the purposes of this tutorial. You can compare your new talairach to the one in subject5_after.

FsTutorial/Talairach_tktools (last edited 2013-11-01 14:28:54 by MaritzaEbling)