The purpose of this tutorial is to get you acquainted with the concepts need to perform multi-modal integration in FreeSurfer using fMRI and DTI analysis. You will not learn how to perform fMRI or DTI analysis here; that knowledge is already assumed. The fMRI makes use of data from the Functional Biomedical Informatics Research Network (fBIRN, www.nbirn.net).
1.1.1. 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/multimodal/fmri/fbirn-101
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).
1.1.2. 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/multimodal/fmri/fbirn-101
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.
1.2. Basic Manual Registration
The purpose of this exercise is to:
- Familiarize you with the tkregister2 command interface.
- Show you how to make manual adjustments to the registration.
- Show you what a bad registration is and how hard it is to fix manually.
First, load a functional volume with the anatomical volume using tkregister2:
tkregister2 --mov template.nii --s fbirn-anat-101.v4 \ --regheader --reg myregister.dat --surf
The FreeSurfer subject name is "fbirn-anat-101.v4". --regheader indicates that tkregister2 should assume that the volumes are already in registration. myregister.dat is the output registration (does not exist yet). This should bring up an interface that looks like this:
- The gray scale image is the functional.
- The green line is the white surface.
- Note that they are not at all in alignment.
- Gray matter and CSF are bright while white matter is dark.
Things to do:
- Click in the image window and hit the 's' key to toggle the surface on and off.
- Click on the "COMPARE" button to toggle between the functional and the anatomical. Note that the green surface is aligned with the anatomical.
- Change orientation by clicking on the "CORONAL", "SAGITTAL", and "HORIZONTAL" buttons.
- NOTE: DO NOT SPEND MORE THAN 5min DOING THIS STEP! Attempt to register the functional manually by adjusting the "TRANSLATE BRAIN" and "ROTATE BRAIN" sliders. Do NOT use "SCALE BRAIN".
- You can hit the "SAVE REG" button at any time to save a registration. If you hit it again, it will ask you if it is ok to overwrite it (it is).
1.2.1. Optional: Manual Registration in freeview
If you wanted to use freeview instead of tkregister2, you could run the command below in place of the tkregister2 command above:
freeview -v template.nii \ $SUBJECTS_DIR/fbirn-anat-101.v4/mri/orig.mgz:visible=0 -f \ $SUBJECTS_DIR/fbirn-anat-101.v4/surf/lh.white:edgecolor=green \ $SUBJECTS_DIR/fbirn-anat-101.v4/surf/rh.white:edgecolor=green \ -viewport coronal
Notice how the surfaces do not line up with the anatomy in the functional volume. You can turn the orig volume on and off to see how much the registration is off. To do manual registration in freeview, select the volume you want to adjust (in this case, choose template) and then go to the 'Tools' menu and select 'Transform Volume'. Hit 'OK' to the warning that pops up. Select the 'Translate' tab and play around with the sliders until the surfaces follow the anatomy better. You could play with the Rotation, as well. When you are happy with your results, save the registration file and/or the resampled volume. If you would like to start over, you can choose 'Restore to Original'.
1.3. Automatic Registration
The purpose of this exercise is to show you how to use the automatic registration program (bbregister). To run, cut and paste this command into your shell:
bbregister --mov template.nii --bold \ --s fbirn-anat-101.v4 \ --init-fsl --reg register.dat
- --bold indicates that the template has bold/T2 contrast (meaning that gray matter is brighter than white matter).
--init-fsl indicates that the program should use FSL FLIRT. You must have FSL installed.
- register.dat is the output file
- This will take about 5 min (the same amount of time you spent manually, right?)
1.4. View Automatic Registration
Look at the register.dat text file created:
Click here to see an example. Load a functional volume with the anatomical volume specifying the recently created automatic registration:
tkregister2 --mov template.nii --reg register.dat --surf
- The subject is not specified since it is in the register.dat
- --regheader is not used
Things to do or try:
- How does it look compared to your manual registration above? Can you make it any better?
1.4.1. Optional: Automatic Registration and freeview
You could do the above action in freeview as well:
freeview -v $SUBJECTS_DIR/fbirn-anat-101.v4/mri/orig.mgz \ template.nii:reg=bb.register.dat -f \ $SUBJECTS_DIR/fbirn-anat-101.v4/surf/lh.white:edgecolor=green \ $SUBJECTS_DIR/fbirn-anat-101.v4/surf/rh.white:edgecolor=green \ -viewport coronal
Select the template volume and hit Alt+v to switch between the template and orig or change the opacity value on the top volume to observe the quality of the alignment. See how much better the registration is now?