FreeSurfer
Getting Started with FreeSurfer
- You will want to make sure you have some familiarity with Unix and the Command Line before you begin learning FreeSurfer
FreeSurfer is the software we use to process MRI images into usable data. We surface area, volume, distances, and other data for cortical and subcortical structures by running MRI files through FreeSurfer. We then manipulate that data using statistical tools, especially R.
FreeSurfer is a software program, which means it is looking to do specific tasks according to its program. Not surprisingly, it can therefore make mistakes especially if the original MRI files are not of a good resolution or otherwise corrupted.
Much of our job when using FreeSurfer deals with learning how to run data through the software and fixing the mistakes it may have made.
Source and Start Up FreeSurfer
Using FS can only be done on a computer which has the software installed already. FS is installed on all machines in the lab. If your personal machine is a Mac, you may choose to install the software and it should work well if your machine has sufficient hardware to handle it. If your personal machine is a PC, you will either need to do these FS training on the lab computers or learn how to connect to a virtual Linux machine. FS programming is not built to run on PC, so please do not download it to your computer, just find a way to use a Mac or virtual machine.
Instructions:
- Open up the Terminal
- Execute the following two lines:
- export FREESURFER_HOME=/Applications/freesurfer
source $FREESURFER_HOME/SetUpFreeSurfer.sh- note: the FREESURFER_HOME variable should denote the correct path to the freesurfer folder. /Applications/freesurfer may not be the correct path on your machine. If it is not, edit the path to point to the freesurfer folder
- export FREESURFER_HOME=/Applications/freesurfer
- After sourcing this variable, you should see a few lines of output that tell you some details about setting up the environment. This means that the command worked and you can now use FreeSurfer
- You can also test that FS is sourced by simply trying the command "fs". If no output occurs, you have not correctly sourced FS
These instructions are adapted from the Harvard FS website:
View Files in Freeview
Knowing how to load files into FS will help you get a head start in understanding the training modules.
- Start by opening freeview, either by typing the command 'freeview' into the terminal or clicking on the application
- Click File -> New Volume, or click the New Volume icon in the top left of the window (it has an outline of a head with a little sunflower on it)
- Select a T1 or brain mask file ending in .mgz from the sample data set located on the server (see the "Lab Server" tab for instruction on how to access/mount the server)
- Opening one of these files this way should enable you to view it in freeview
- You are now basically equipped to work on the training modules. you will learn other ways to interact with freeview, like loading volumes and surfaces directly from the terminal, which is more convenient sometimes. This should get you started, though
FreeSurfer Training Modules
After Completing FreeSurfer training
Become familiar with how we track edits by viewing this sheet.
Click here to download helpful Wiki pages, articles to read, and a reference for the different types of edits