Differences between revisions 1 and 18 (spanning 17 versions)
Revision 1 as of 2005-09-06 22:32:25
Size: 6044
Editor: anonymous
Comment: missing edit-log entry for this revision
Revision 18 as of 2011-06-29 10:57:05
Size: 8102
Editor: KhoaNguyen
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
[wiki:Self:FsTutorial top] | [wiki:Self:FsTutorial/FslFeatFreeSurfer previous] [[FsTutorial|top]] | [[FsTutorial/FslFeatFreeSurfer|previous]]
Line 5: Line 5:
The registration is a multi-step process. Each step is described in detail below. To begin the exercises, first enter the following directory: The registration is a multi-step process. Each step is described in detail below.
=== Preparations ===
To begin the exercises, first enter the following:

==== If You're at an Organized Course ====
If you are taking one of the formally organized courses, everything has been set up for you on the provided laptop. The only thing you will need to do is run the following commands in ''every'' '''new''' terminal window (aka shell) you open throughout this tutorial. Copy and paste the commands below to get started:

----
Line 7: Line 14:
cd $FREESURFER_HOME/subjects/buckner_data/tutorial_subjs setenv SUBJECTS_DIR $TUTORIAL_DATA/buckner_data/tutorial_subjs
cd $SUBJECTS_DIR/fbert-feat
ln -s $FREESURFER_HOME/subjects/fsaverage
ln -s $FREESURFER_HOME/subjects/bert
Line 9: Line 19:
''To copy: Highlight the command in the box above, right click and select copy (or use keyboard shortcut Ctrl+c), then use the middle button of your mouse to click inside the terminal window (this will paste the command). Press enter to run the command.''
Line 10: Line 21:
If you have not already set the SUBJECTS_DIR environment variable to point to this FsTutorialDataSet directory, then set the current directory to be the default subjects directory using this command: These two commands set the SUBJECTS_DIR variable to the directory where the data is stored and then navigates into this directory. You can now skip ahead to the tutorial (below the gray line).

==== If You're not at an Organized Course ====
If you are '''NOT''' taking one of the formally organized courses, then to follow this exercise exactly be sure you've downloaded the [[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. These are the commands that you need to run before getting started:
Line 12: Line 27:
setenv SUBJECTS_DIR ${PWD} tcsh
source your_freesurfer_dir/SetUpFreeSurfer.csh
setenv SUBJECTS_DIR $TUTORIAL_DATA/buckner_data/tutorial_subjs
cd $SUBJECTS_DIR/fbert-feat
ln -s $FREESURFER_HOME/subjects/fsaverage
ln -s $FREESURFER_HOME/subjects/bert
Line 14: Line 34:
Notice the command to open tcsh. If you are already running the tcsh command shell, then the 'tcsh' command is not necessary. If you are not using the tutorial data you should set your {{{SUBJECTS_DIR}}} to the directory in which the recon(s) of the subject(s) you will use for this tutorial are located.
Line 15: Line 36:
And then remove any results from any previous registrations and resamplings:
{{{
rm -rf ./fbert.feat/reg/freesurfer
rm -rf ./fbert.feat/reg_surf-*
}}}
--------

The subjects 'fsaverage' and 'bert' may already exist in the subjects directory, so ignore any warnings that might be issued that say 'File exists'.
Line 24: Line 43:
----
Line 27: Line 47:
Now, run the registration for bert: ----
Now, run the registration for bert's first fMRI data:
----
Line 29: Line 51:
reg-feat2anat --feat fbert.feat --subject bert reg-feat2anat --feat fbert1.feat --subject bert
Line 31: Line 53:
Verify that this created directory fbert.feat/reg/freesurfer. There are several files with matrices in them. The most important one is anat2exf.register.dat. ----
Verify that this created directory fbert1.feat/reg/freesurfer. There are several files with matrices in them. The most important one is anat2exf.register.dat.
Line 35: Line 58:
You should ALWAYS visually check your registration. This is done with tkregister2. This program brings up a GUI which allows you to inspect and interactively edit the registration matrix. It is a complicated program with lots of features. You can get a full help on it with: You should ALWAYS visually check your registration. This is done with tkregister2 through reg-feat2anat. This program brings up a GUI which allows you to inspect and interactively edit the registration matrix. tkregister2 is a complicated with lots of features. You can get a full help on it with:
----
Line 39: Line 63:
----
Line 40: Line 65:
----
Line 41: Line 67:
reg-feat2anat --feat fbert.feat --subject bert --manual reg-feat2anat --feat fbert1.feat --manual
Line 43: Line 69:
----
Line 45: Line 72:
attachment:tkr-interface.jpg {{attachment:tkr-interface.jpg}}
Line 49: Line 76:
attachment:tkr-anat-sag-151-small.jpg
attachment:tkr-func-sag-151-small.jpg
attachment:tkr-func-sag-151-nosurf-small.jpg
{{attachment:tkr-anat-sag-151-small.jpg}}
{{attachment:tkr-func-sag-151-small.jpg}}
{{attachment:tkr-func-sag-151-nosurf-small.jpg}}
Line 57: Line 84:
A. To switch between the functional and anatomical, press the "COMPARE" button.[[BR]]
B. To change orientation, press the CORONAL, SAGITTAL, or HORIZONTAL button.[[BR]]
C. To change slice, operate the slider.[[BR]]
D. To change the functional brightness, change the value in the "fmov" entry box. Or you can use the 'i' keypress command to turn on automatic intensity normalization.[[BR]]
E. To toggle the surface on and off, use the 's' keypress command.[[BR]]
A. To switch between the functional and anatomical, press the "COMPARE" button.<<BR>>
B. To change orientation, press the CORONAL, SAGITTAL, or HORIZONTAL button.<<BR>>
C. To change slice, operate the slider.<<BR>>
D. To change the functional brightness, change the value in the "fmov" entry box. Or you can use the 'i' keypress command to turn on automatic intensity normalization.<<BR>>
E. To toggle the surface on and off, use the 's' keypress command.<<BR>>
Line 63: Line 90:
You can get more information on keypress commands and general usage with:  You can get more information on keypress commands and general usage with:
Line 70: Line 97:
The first step in evaluation is to make sure that there was no catastrophic failure, e.g., the functional is rotated by 90 degrees with respect to the anatomical, or is shifted by a large amount. Such failures are usually caused by failures in the registration to standard space (see section on troubleshooting).  The first step in evaluation is to make sure that there was no catastrophic failure, e.g., the functional is rotated by 90 degrees with respect to the anatomical, or is shifted by a large amount. Such failures are usually caused by failures in the registration to standard space (see section on troubleshooting).
Line 74: Line 101:
The final step is to check the alignment. This is done by making sure that green surface follows the contour of the CSF.  The final step is to check the alignment. This is done by making sure that green surface follows the contour of the CSF.
Line 80: Line 107:
attachment:tkr-func-sag-151-bright-small.jpg {{attachment:tkr-func-sag-151-bright-small.jpg}}
Line 86: Line 113:
=== 1.7 Check FEAT registration to Standard Space ===

This registration tool can be used to check and adjust the FEAT registration to standard space with:
----
{{{
reg-feat2anat --feat fbert1.feat --manxfm func2std
}}}
----

top | previous

Registering FSL Feat output to the anatomical

The registration is a multi-step process. Each step is described in detail below.

Preparations

To begin the exercises, first enter the following:

If You're at an Organized Course

If you are taking one of the formally organized courses, everything has been set up for you on the provided laptop. The only thing you will need to do is run the following commands in every new terminal window (aka shell) you open throughout this tutorial. Copy and paste the commands below to get started:


setenv SUBJECTS_DIR $TUTORIAL_DATA/buckner_data/tutorial_subjs
cd $SUBJECTS_DIR/fbert-feat
ln -s $FREESURFER_HOME/subjects/fsaverage
ln -s $FREESURFER_HOME/subjects/bert

To copy: Highlight the command in the box above, right click and select copy (or use keyboard shortcut Ctrl+c), then use the middle button of your mouse to click inside the terminal window (this will paste the command). Press enter to run the command.

These two commands set the SUBJECTS_DIR variable to the directory where the data is stored and then navigates into this directory. You can now skip ahead to the tutorial (below the gray line).

If You're not at an Organized Course

If you are NOT taking one of the formally organized courses, then to follow this exercise exactly be sure you've downloaded the 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. These are the commands that you need to run before getting started:

tcsh
source your_freesurfer_dir/SetUpFreeSurfer.csh
setenv SUBJECTS_DIR $TUTORIAL_DATA/buckner_data/tutorial_subjs
cd $SUBJECTS_DIR/fbert-feat
ln -s $FREESURFER_HOME/subjects/fsaverage
ln -s $FREESURFER_HOME/subjects/bert

Notice the command to open tcsh. If you are already running the tcsh command shell, then the 'tcsh' command is not necessary. If you are not using the tutorial data you should set your SUBJECTS_DIR to the directory in which the recon(s) of the subject(s) you will use for this tutorial are located.


The subjects 'fsaverage' and 'bert' may already exist in the subjects directory, so ignore any warnings that might be issued that say 'File exists'.

1.1 Automatic registration

The program that performs the registration is called reg-feat2anat (which uses FLIRT to do the actual computations). Information about how to run this program and what this program is doing can be obtained with:


reg-feat2anat --help


Now, run the registration for bert's first fMRI data:


reg-feat2anat --feat fbert1.feat --subject bert


Verify that this created directory fbert1.feat/reg/freesurfer. There are several files with matrices in them. The most important one is anat2exf.register.dat.

1.2 Manual Checking/Editing the registration

You should ALWAYS visually check your registration. This is done with tkregister2 through reg-feat2anat. This program brings up a GUI which allows you to inspect and interactively edit the registration matrix. tkregister2 is a complicated with lots of features. You can get a full help on it with:


tkregister2 --help


To check the registration computed in the previous step, run:


reg-feat2anat --feat fbert1.feat --manual


You will see the following GUI window:

tkr-interface.jpg

You will also see an anatomical similar to the one on the left below. Pressing the "COMPARE" button will allow you to flip between the anatomical (left) and functional (middle). The green line is the orig surface. It is the same in both the anatomical and functional. The right is the same image as the middle without the surface.

tkr-anat-sag-151-small.jpg tkr-func-sag-151-small.jpg tkr-func-sag-151-nosurf-small.jpg

1.3 Navigating through tkregister2

tkregister2 is controlled through the interface and through keypress commands. When using a keypress command, the image window must have control of the cursor; this can be accomplished by clicking in the image window. Here are some useful commands.

A. To switch between the functional and anatomical, press the "COMPARE" button.
B. To change orientation, press the CORONAL, SAGITTAL, or HORIZONTAL button.
C. To change slice, operate the slider.
D. To change the functional brightness, change the value in the "fmov" entry box. Or you can use the 'i' keypress command to turn on automatic intensity normalization.
E. To toggle the surface on and off, use the 's' keypress command.

You can get more information on keypress commands and general usage with:

tkregister2 --help.

1.4 Evaluating the registration

The first step in evaluation is to make sure that there was no catastrophic failure, e.g., the functional is rotated by 90 degrees with respect to the anatomical, or is shifted by a large amount. Such failures are usually caused by failures in the registration to standard space (see section on troubleshooting).

The second step is to make sure there was not a left-right flip. This is tricky because the brain is very symmetrical. However, the cortical folding patterns often have subtle asymmetries. In general, you cannot see the folding patterns in the functional, but you can see the CSF which will also follow the surface (see the images above). Make sure that asymmetries in the (green) surface are present in the CSF.

The final step is to check the alignment. This is done by making sure that green surface follows the contour of the CSF.

1.5 Pitfalls

There are several ways in which the registration may be good but can appear bad. First, don't evaluate the registration in areas known to have B0 distortion (e.g., orbital frontal, medial temporal lobe). Second, be careful using the ventricles for alignment. The anterior portion is often susceptible to B0 distortion. Third, if it looks like the surface cuts through a CSF fold, look at adjacent slices to see if it lines up better. This can happen because functional voxels are so big. Finally, be careful trying to use what looks like the edge of the brain in the functional. For example, in the middle image above, it looks like the surface extends beyond the top of the brain. However, if we adjust the brightness (set fmov to 1; see image below), one can clearly see that the surfaces are actually in brain.

tkr-func-sag-151-bright-small.jpg

1.6 Editing the registration

If for some reason you do not believe that the automatic registration is sufficiently close, you can edit the registration manually. tkregister allows you to translate, rotate, and scale the brain using the sliders on the right side of the GUI. All the modifications happen in the viewing plane. The rotations are about the red cross. Note: you should not need to adjust the scale (ie, stretch the brain) because both brains belong to the same person. This is equivalent to contraining the registration to be rigid (ie, 6 DOF). When done, press the "SAVE REG" button. Note that if you modify the registration, don't re-run reg-feat2anat as that will overwrite your edits. As an exercise, try translating the functional. First, view the functional and then move the "TRANSLATE" slider. You will see the functional brain translate (the green surface will be fixed). DON'T save the registration (if you do, then just re-run reg-feat2anat).You can get more information on editing the registration with: tkregister2 --help.

1.7 Check FEAT registration to Standard Space

This registration tool can be used to check and adjust the FEAT registration to standard space with:


reg-feat2anat --feat fbert1.feat --manxfm func2std


FsTutorial/RegisterFeatOntoAnatomical (last edited 2016-09-23 10:10:00 by AllisonMoreau)