The purpose of this multimodal tutorial is to get you acquainted with the concepts needed 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. 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:
export 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 the directory within the SUBJECTS_DIR that you will use for this part of the tutorial. You can now skip ahead to the tutorial (below the gray line).
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:
## bash <source_freesurfer> export TUTORIAL_DATA=<path_to_your_tutorial_data> export SUBJECTS_DIR=$TUTORIAL_DATA/buckner_data/tutorial_subjs cd $SUBJECTS_DIR/multimodal/fmri/fbirn-101 ## tcsh source $FREESURFER_HOME/SetUpFreeSurfer.csh setenv TUTORIAL_DATA <path_to_your_tutorial_data> setenv SUBJECTS_DIR $TUTORIAL_DATA/buckner_data/tutorial_subjs cd $SUBJECTS_DIR/multimodal/fmri/fbirn-101
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.
2. Basic Manual Registration
The purpose of this exercise is to:
Familiarize you with the FreeView 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.
Using the following command, you can run FreeView using a wrapper script. This script can be an efficient way to open FreeView without having to type a long, cumbersome command.
tkregisterfv --mov template.nii --s fbirn-anat-101.v4 --reg manreg.lta
tkregisterfv will output the FreeView command that it calls. For this example, it should output the following in the terminal:
freeview -transform-volume -viewport cor -v /home/nmrclass/tutorial_data/buckner_data/tutorial_subjs/fbirn-anat-101.v4/mri/orig.mgz:visible=0:name=orig.mgz(targ) /home/nmrclass/tutorial_data/buckner_data/tutorial_subjs/multimodal/fmri/fbirn-101/template.nii:name=template.nii(mov):reg=/home/nmrclass/tutorial_data/buckner_data/tutorial_subjs/multimodal/fmri/fbirn-101/manreg.lta --surface /home/nmrclass/tutorial_data/buckner_data/tutorial_subjs/fbirn-anat-101.v4/surf/lh.white:edgecolor=yellow --surface /home/nmrclass/tutorial_data/buckner_data/tutorial_subjs/fbirn-anat-101.v4/surf/rh.white:edgecolor=yellow
It should also bring up an interface that looks like this:
- The grayscale image is the functional data.
- The yellow line is the white surface.
- Gray matter and CSF are bright while white matter is dark.
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'. 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 ('Save Reg') and/or the resampled volume ('Save Volume As'). If you would like to start over, you can choose 'Restore to Original'. Note, FreeView will save .lta type registration files.
3. Automatic Registration
The purpose of this exercise is to show you how to use the automatic registration program (bbregister). To run, copy and paste this command into your shell:
bbregister --mov template.nii --bold --s fbirn-anat-101.v4 --reg register.lta
- --bold indicates that the template has bold/T2 contrast (meaning that gray matter is brighter than white matter).
- --lta indicates that the output registration file is register.lta (Note, currently register.dat will also be written into the output directory for backwards compatibility).
- This will take about 5 min (the same amount of time you spent manually, right?).
4. View Automatic Registration
Look at the register.lta text file created:
Click here to see an example.
In order to load a functional volume with the anatomical volume specifying the recently created automatic registration:
tkregisterfv --mov template.nii --reg register.lta
Select the template volume and hit Alt+c 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? How does it compare to your manual registration? Note that you do not need to specify the subject name because that is in the registration file generated by bbregister.
- The subject is not specified since it is in the register.dat.
- --regheader is not used.
How does this registration look compared to your manual registration above? Can you make it any better?