Differences between revisions 9 and 10
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:

 *To follow this exercise exactly be sure you've downloaded the [wiki:Self: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.

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

  • 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.

Fixing Bad Output From the Talairach Registration

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.

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.

In case of a bad transform, there are some [wiki:FsTutorial/TalairachAuto automatic ways to regenerate the transform]. If the transform still looks bad after trying the automatic methods, you can try a manual registration described below.

Go into the talairach_tutorial directory, set your SUBJECTS_DIR environment variable to the current directory, and open the 095_before brain volume with tkmedit:

cd $FREESURFER_HOME/subjects/buckner_data/tutorial_subjs
setenv SUBJECTS_DIR ${PWD}
tkmedit 095_talairach_before brain.mgz &

In the tkmedit toolbar, go to:

File -> Transforms -> Load Transform for Main Volume...

Click browse, select the file talairach.xfm and click 'OK'.

As you can see in the coronal view, the transform has resulted in an extremely distorted brain.

Now, run tkregister2 to open an interface to adjust the registration:

tkregister2 --mgz --s 095_talairach_before --fstal --surf orig 

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.

Note: do not run the Talairach stage of the FreeSurfer reconstruction or your manual edits will be overwritten. E.g., when running recon-all, use the -notalairach flag.

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