PC/SJ 10/9/2002
FreeSurfer Workshop
Shruti Japee and Peggy Christidis
National Institute of Mental Health
ThursdayFriday, November 18, 2004August 23October 11, 2002
GOAL OF FREESURFER WORKSHOP
· Learn to create surfaces using the FreeSurfer software
(Available at http://surfer/nmr.mgh.harvard.edu/download.html)
· Specifically, start with an anatomical scan off of the scanner volume from the scanner, and create a surface by following the steps shown in the flowchart below.
· Transfer surface to SUMA (Z. Saad, 2002) to overlay functional data.
STEPS INVOLVED (FLOWCHART)
1) VOLUME PRE-PROCESSING
Starting with raw data (I-files):
· Create AFNI dataset using to3d.
Usage: to3d [-options] <image files>
Class Example: cd lc_play
foreach x (1 2 3 4)
to3d -prefix mprage{{$x}} 00{{$xx}}/I.*
end
· Convert AFNI dataset to MINC format using 3dAFNItoMINC.
Usage: 3dAFNItoMINC [-options] <AFNI dataset.BRIK>
Class Example:
foreach x (1 2 3 4)
3dAFNItoMINC mprage{$x}+orig.BRIK
end
· Perform an N3* correctionintensity normalization using the MNI (Montreal Neurological Institute) tool, nu_correct.the AFNI program 3dUniformize.
Usage: nu_correct [-options3dUniformize] -anat AFNI datasetinput.mnc> <output.mnc>-prefix <prefix name>
Class Example:
foreach x (1 2 3 4)
nnu_correct -clobber -stop 0.0001 -iterations 100 \
-distance 50 mprage{$x}.mnc mprage{$x}_n3.mnc3dUniformize -quiet -anat mprage{$x}+orig -prefix mprage{$x}_n3
end
** Note: An N3 (= Non-parametric Non-uniform intensity Normalization) correction can be done with the Montreal Neurological Institute tool “nu_correct”. Substantially improves the accuracy of anatomical analysis techniques such as tissue classification and cortical surface extraction. (For more information, see:
Sled, J. G., A. P. Zijdenbos, et al. (1998). "A nonparametric method for automatic correction of intensity nonuniformity in MRI data." IEEE Trans Med Imaging 17(1): 87-97.) Arnold, J.B., J.S. Liow, et al. (2001). “Qualitative and quantitative evaluation of six algorithms for correcting intensity nonuniformity effects.” Neuroimage 13(5):931-943.
· Convert MINC dataset back to AFNI using 3dMINCtoAFNI (optional since 3dvolreg also reads minc files).
·
· Register your datasets using AFNI’s 3dvolreg.
Usage: 3dvolreg -base <bname> -prefix <pname> <target file>
Class Example:
foreach x (2 3 4)
3dvolreg -base mprage1_n3+orig.mnc -prefix mprage{{$x}}_n3vr \
mprage{{$x}}_n3+orig.mnc
end
· Average your datasets using AFNI’s 3dmerge or 3dMean.
Usage: 3dMean -prefix <pname> <datasets …>
Class Example:
3dMean -prefix mprage_avg mprage*?_n3vr+orig.BRIK.BRIK \
mprage1_n3+orign3.mnc
· Create FreeSurfer’s directory structure:
Usage: mksubjdirs <subject name>
Class Example:
mksubjdirs lc_avg
lc_play/
bem/ label/ morph/ mpg/ mri/ rgb/ scripts/ surf/ tiff/ tmp/
T1/ aparc/ brain/ filled/ orig/ tmp/ transforms/ wm/
· Convert volume into FreeSurfer COR format:
Usage: mri_convert <orig_dataset> ./
Class Example:
cp mprage_avg+orig.* lc_avg/mri/orig
cd lc_avg/mri/orig
mri_convert mprage_avg+orig.BRIK ./
2) SEGMENTATION
· From Graphical User Interface (GUI): SubjectTools à Process Volume
Result: Normalizes intensity, strips skull, and segments white matter.
· From Command Line:
Usage: segment_subject <subject_name>
Class Example:
cd ../../.. (i.e., go back up to lc_play directory)
option 1: segment_subject lc_avg
option 2: recon-all -stage1 -stage2 -nomotioncor -subjid lc_avg
Result: Normalizes intensity, strips skull, segments white matter, AND
cuts planes, fills, tessellates, smoothes, inflates.
· This process takes approximately 105-1520 minutes for both the per hemispheres to run to completion.
3) INFLATION (for GUI users only)
· Note: If using the command line option, skip this step and proceed to manual editing.
· From GUI: SubjectTools à Create Surface
Result: Cuts planes, fills, tessellates, smoothes, inflates surface.
· Now is a good time to look at your inflated surface and check for topologic defects.
(SubjectTools à Edit Segmentation)
· This process takes approximately 10-2150 minutes per for both hemispheres. to run to completion.
·
4) MANUAL EDITING
· This procedure follows the Create Surface step, once the surface has finished inflating. It is the only manual step of the standard reconstruction process and may require several iterations.
· Note: The FreeSurfer gurus at MGH mention that this (somewhat painful) step is only required if you wish to proceed with inter-subject averaging and morphometric studies.
· There are two main causes of topologic defects:
1. segmentation errors (i.e. a white matter voxel is incorrectly classified as non-white or vice-versa)
2. non-cortical anatomic structures (e.g. fornix, basal ganglia, ventricles)
· The most common anatomically derived defects that require manual editing are:
1. Fornix (results in handles in the hemisphere’s surface)
2. Lateral Ventricle (results in a hole in the hemisphere’s surface)
3. Basal Ganglia (results in a hole in the hemisphere’s surface)
4. Optic Nerve (which doesn't result in topological defects, but interferes with inflation)
· Excellent tutorial available on FreeSurfer Website to guide you through manual editing:
http://surfer.nmr.mgh.harvard.edu/docs/index.html
· Smaller topologic defects can be fixed via “Fix Surface Topology.”
5) RE-INFLATION
· The manual editing and inflation steps should be repeated until all the large topologic defects have been corrected.
· From GUI: SubjectTools à Create Surface
· From Command Line:
option 1: inflate_subject lc_avg
option 2: recon-all -stage2 -subjid lc_avg
· Note: Do NOT proceed with “Fix Surface Topology” until you have completed manual editing.
6) FIX SURFACE TOPOLOGY
· Once the surface is free of large anatomically derived defects, the automated topology fixer can be used to remove smaller topological defects.
· From GUI: SubjectTools à Fix Surface Topology
· From Command Line:
Usage: fix_subject <subject_name>
Class Example:
option 1: fix_subject lc_avg
option 2: recon-all -stage3 -subjid lc_avg
· This process takes approximately 2 hrs per hemisphere to run to completion.
7) MAKE FINAL SURFACES
· This step starts a fully automated, two-part background process to create the final left and right hemisphere cortical surfaces. The gray/white boundary is called ?h.white and the gray/csf boundary is called ?h.pial.
· The white and pial surfaces are used to estimate the cortical thickness at all locations on the cortical surface. The thickness estimates are stored in a curv file called ?h.thickness.
· From GUI: SubjectTools à Make Final Surface
· From Command Line:
Usage: make_final_surfaces_subject <subject_name>
Class Example:
option 1: make_final_surfaces_subject lc_avg
option 2: recon-all -stage4a -subjid lc_avg
· The two-part processes take a total of approximately 4-6 hrs per hemisphere to run to completion.
8) CUT AND FLATTEN SURFACE
· This process is optional and provides the user with flattened images of the whole brain or select parts (e.g. occipital lobe) of the brain.
Full Surface Cuts:
Five “relaxation” cuts will need to be made – one across the calcarine sulcus, three radial cuts along the medial surface, and one sagitally oriented cut around the temporal lobe.
1. Go to main GUI and select SubjectTools à Make Full Surface Cuts.
2. For each cut, select the points that will form that cut (using the LEFT mouse button).
3. Press the CUT LINE button on the TK Surfer Interface to connect the points and form a cut line. Follow this step for each of the five relaxation cuts.
4. Make a final cut that encircles the midline region. Rather than pressing the CUT LINE button, press the CUT CLOSED LINE button.
5. Select a point on the surface outside the midline region.
6. Press the CUT AREA button.
7. Save the patch as ?h.full.patch.3d
Occipital Cuts:
1. Go to main GUI and select SubjectTools à Make Occip Surface Cuts.
2. Select points across the calcarine fissure and press CUT LINE on the TK Surfer Interface.
3. Select 3 points to define the cutting plane, two on the medial side and one on the lateral side.
4. Choose a fourth point to specify which portion of the surface to keep.
5. Make the planar cut by pressing the CUT PLANE button on the TK Surfer Interface.
6. Save the patch as ?h.occip.patch.3d
Flatten Surface:
· From GUI: SubjectTools à Flatten Surface
· From Command Line:
Usage: mris_flatten <input patch> <output patch>
Class Example:
mris_flatten ?h.full.patch.3d ?h.full.patch.flat
· This process takes approximately 816-120 hrs per full hemisphere and 612 hours per hemisphere for the occipital surface.
9) VOLUME/SURFACE POST-PROCESSING
· Your surfaces are now ready and can be transferred over to SUMA.
· Use Ziad’s post-processing script to prepare the surfaces and create the necessary spec files.
Usage: @SUMA_Make_Spec_FS –sid subjectID
Class Example:
cd /home/user/lc_play/lc_avg4_gold
@SUMA_Make_Spec_FS –sid lc
This creates an AFNI dataset of the volume used to create the surface, i.e., lc_SurfVol+orig.BRIK, SUMA spec files for the left and right hemispheres and converts the surfaces into ASCII format.
· Start up SUMA and AFNI to ensure that the surface is in register with the surface volume.
Class Example:
cd SUMA
afni –niml &
suma –spec lc_lh.spec –sv lc_SurfVol+orig.BRIK
· Note: Surfaces will need to be saved in ASC-II format in order to be read by SUMA.In the SUMA window hit the ‘t’ key to get AFNI and SUMA to communicate. You should now see the outline of the surface in the AFNI window.
· To overlay functional data onto the surface:
Class Example:
cd ../../func
to3d –prefix ExpVol 001/I.*
(This writes out an AFNI dataset of the anatomical scan that is in register with the functional data)
@SUMA_AlignToExperiment ExpVol+orig.BRIK \ ../lc_avg4_gold/SUMA/lc_SurfVol+orig.BRIK
· Now start AFNI and SUMA (from within the lc_play/func/ directory):
Class Example:
afni –niml &
suma –spec ../lc_avg4_gold/SUMA/lc_lh.spec \
–sv lc_SurfVol_Alnd_Exp+orig.BRIK
· Load the lc_SurfVol_Alnd_Exp+orig.BRIK as the anatomy and appropriate functional data in AFNI (i.e., Define Datamode and Define Function). Hit the ‘t’ key in the SUMA window to have AFNI talk to SUMA and then hit the ‘f’ key to view the function overlaid on the surface.
· For more details on how to use SUMA visit:
http://afni.nimh.nih.gov/ssc/ziad/SUMA
· From Command Line: mris_convert <file name.asc>
· Examples:
lh.inflated: mris_convert lh.inflated.asc
lh.occip.patch.3d: mris_convert –p lh.occip.patch.3d.asc
OR, SUMA can automatically convert your files into ASCII format for you.
5