FreeSurfer For Martinos Users
Multiple FreeSurfer distributions can be accessed from any Linux computer on the Martinos network. This page will show you how to access a FreeSurfer distribution and point you towards some tutorials to help learn how to use it.
Accessing FreeSurfer Distributions
Consider that when processing a group of subjects for your study, it is essential to process all your subjects with the same version of FreeSurfer, on the same OS platform and vendor, and for safety, even the same version of the OS. While we continue to work to ensure that results match across platforms, there are none-the-less system-level libraries that are OS dependent. An exception to this rule is that you may view and edit files across any platform or version, and run some post-processing tools (outside the recon-all stream). Please check with the FreeSurfer developers first if you have questions (for instance you may run the longitudinal processing with newer versions of FreeSurfer).
For example, if you are about to process new data with FreeSurfer, then we recommend using the latest release. As of this writing, the latest Freesurfer release is version 7.1.1 (from July of 2020). To use the 7.1.1 release, you would copy and paste this command into your terminal window:
Version 7.1.1 release:
If you are in the process of analyzing data with the previous FreeSurfer version 6 release, then run this command in order to continue to work with version 6:
Version 6 release:
You can also choose the FreeSurfer 7.X.X development stream which is not tested or considered to be as stable as an existing FreeSurfer release. Please note the development stream distribution can change on a daily basis since it accumulates the latest functionality, enhancements and bug fixes (visible from the FreeSurfer git project source control log):
Non-release Freesurfer development stream:
To ensure one of the above commands worked, type freeview into the command prompt, press enter, and see if FreeView opened. FreeView is a tool that comes with FreeSurfer - it lets you look at the data FreeSurfer creates along with many other files common to MRI research.
A note on Bash vs TCSH
Most of FreeSurfer is used through typing commands into the terminal. Different labs use different terminal languages - these languages are called shells - some commands you type in to use FreeSurfer are slightly different depending on which shell your computer uses. Your computer probably uses Bash or TCSH, to figure that out enter the following command into the terminal.
The output will show a path, the final part of that path will be the name of your shell.
If you follow the FreeSurfer Tutorials to learn FreeSurfer, you will be guided through the differences in Bash and TCSH that matter to FreeSurfer. One example difference is how you would tell FreeSurfer where to save your processed subject data. Here is how that would look in each shell.
setenv SUBJECTS_DIR /some/path_to/your/subjects
If you would like to change shell at any time, type in the name of the shell you would like into the terminal: bash or tcsh . Note that new terminal windows will still use your usual default shell.
Learning how to use FreeSurfer
Here is a recommended way to get up to speed on using FreeSurfer:
If you are not familiar with using a Unix terminal, watch this video: https://www.youtube.com/watch?v=6eJMxh7PlOY
Here is a link to online versions of a FreeSurfer course: https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial
Each lecture has a corresponding video found here: https://www.youtube.com/channel/UCruQerP8aa-gYttXkAcyveA
To get a basic understanding of FreeSurfer it is recommended to go through all course material up to and including "Quality Checking a Recon". From there you can complete the rest to explore different specific functions of FreeSurfer, or select tutorials related to the research you plan to do.
Processing your first subject
If you have data you would like to process with FreeSurfer, you can do so using the command recon-all. An example of how to run this command is below:
First, make sure your computer is set up to run FreeSurfer. Follow the accessing FreeSurfer section above to do so.
Choose a directory where you would like FreeSurfer to store your processed data. See the A note on Bash vs TCSH section above to do so.
Navigate to the directory of your DICOM image data with cd /path/to/data/here , then run the following command:
recon-all -all -i <one slice in the anatomical dicom series> -s <subject id that you make up>
Things to note:
-all will run all the steps in the FreeSurfer processing stream. Alternatively, you can run different parts of the stream.
-i stands for input. Here, you would specify one dicom file/slice in the MPRAGE scan series you collected ( FreeSurfer will find the rest of the slices automatically). You could also specify nifti files as input. If you have more than one MPRAGE or input for a given subject, use another -i flag for each one.
-s specifies the name of the subject and will create a directory with that name for all the subject's FreeSurfer output.
The process is complete when the last line printed to the screen (and in the recon-all.log found in the subject's scripts directory) says "recon-all exited without errors". If you run into errors, search the mailing list for help or follow the steps in BugReporting.
General Linux Help
Examples of scripts and aliases that can make it easier to source, use, and process with FreeSurfer can be found here.
Some basic information on text editors can be found here.
There is a wealth of knowledge here on the FSWiki. On the top right hand corner is a search bar - be sure to press the Text option when searching, it offers more results than Topic.
Other resources include an online support archive, see here for more details: https://surfer.nmr.mgh.harvard.edu/fswiki/FreeSurferSupport
You may find these wiki pages helpful as you get started: