Table of Contents

Freesurfer Guide

How to run Freesurfer on Golgi

The tutorial below will refer to running Freesurfer to create the segmentation images, the inflated images, the parcellation images, and all of the other supplemental files it creates.

Create your data directories

Under your data folder (/data/users/yourusername/) create a “freesurfer” folder. Under this folder, create two subfolders, “subjects” and “sessions”. You need the “subjects” directory for 3-D surface reconstruction and segmentation; the “sessions” directory will be needed later if you use FreeSurfer tools for functional analysis.

Directory Tree:
/data/users/yourusername
  - freesurfer
    -- subjects
    -- sessions

Set up your environment

set SUBJECTS_DIR = /data/users/$user/freesurfer/subjects  
set FUNCTIONALS_DIR = /data/users/$user/freesurfer/sessions  
source /usr/local/packages/freesurfer-dev2-0-0/SetUpFreeSurfer.csh

Upload/copy your data to the freesurfer directory

Directory Tree:
/data/users/yourusername
  - freesurfer
    -- SubjectNumber1
       --- series500
           ---- All .dcm files of T1-weighted data here
    -- subjects
    -- sessions

Run Freesurfer

/usr/local/bin/
Example from the directory tree above:
> runfreesurfer Subject1 series500
> grep finished recon.log

Visualization of FreeSurfer results

Using fScan for visualizing FreeSurfer

How do I get the data back into the original space?

The volume output (aseg.mgz, aparc+aseg.mgz, etc…) of Freesurfer will probably be in a different image space than your original data (this output is always 256x256x256, 1mm^3, and in coronal orientation). If you'd like to get this data back into the same space as your orignal data, you can use the freesurfer command “mri_convert” to do this:

mri_convert -rl rawavg.mgz -rt nearest aseg.mgz aseg2raw.nii.gz

where the -rl flag means “reslice like” (basically the “target”; the file “rawavg.mgz” in the mri/ folder is in the original image space) and -rt is the resample type (interpolate, weighted, nearest, sinc or cubic; default is interpolate). For label files like aseg.mgz and aparc+aseg.mgz, you'll want to use “nearest” so you don't get fractional values.