FreeSurfer For Martinos Users

FreeSurfer can be accessed from any Linux computer on the Martinos network. This page will show you how to access the FreeSurfer program and points you towards some tutorials to help learn how to use it.

Accessing FreeSurfer

First, consider if you need access to the stable or development version of FreeSurfer. If you are not sure, you probably want to use the stable version. The development version contains new and untested features.

For whichever version you want, copy and paste a command below into your terminal:

Stable:

source /usr/local/freesurfer/fs-stable-env-autoselect

Development:

source /usr/local/freesurfer/fs-dev-env-autoselect

To ensure that 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.

echo $SHELL

The output will show a path, the final part of that path will be the name of your shell.

bashshell.png

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.

Bash

export SUBJECTS_DIR=/some/path_to/your/subjects

TCSH

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:

  1. If you are not familiar with using a Unix terminal, watch this video: https://www.youtube.com/watch?v=6eJMxh7PlOY

  2. 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:

  1. First, make sure your computer is set up to run FreeSurfer. Follow the accessing FreeSurfer section above to do so.

  2. 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.

  3. 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:

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

Need help?

Other resources

You may find these wiki pages helpful as you get started:

FreeSurferForMartinosUsers (last edited 2019-11-13 14:24:45 by MatthewLarrabee)