+ All Categories
Home > Documents > FreeSurfer Why use FreeSurfer? What happens? How do I do ... · • FreeSurfer can read/write:...

FreeSurfer Why use FreeSurfer? What happens? How do I do ... · • FreeSurfer can read/write:...

Date post: 10-Aug-2020
Category:
Upload: others
View: 7 times
Download: 1 times
Share this document with a friend
18
1 FreeSurfer http://surfer.nmr.mgh.harvard.edu Register Download Platforms: Linux and Mac [email protected] Why use FreeSurfer? What happens? How do I do that? Now What? Surface and Volume Analysis Cortical Reconstruction and Automatic Labeling Inflation and Functional Mapping Surface Flattening Surface-based Intersubject Alignment and Statistics Automatic Subcortical Gray Matter Labeling Automatic Gyral White Matter Labeling Cortical Surface Reconstruction FreeSurfer creates computerized models of the brain from MRI data. Input: T1-weighted (MPRAGE,SPGR) 1mm 3 resolution (.dcm) Output: Segmented & parcellated conformed volume (.mgz) MGZ File Format 001.mgz • mgz = compressed MGH file • Can store 4D (like NIFTI) • cols, rows, slices, frames • Generic: volumes and surfaces • Eg, Typical Anatomical volume: 256 x 256 x 128 x 1 FreeSurfer can read/write: NIFTI, Analyze, MINC Careful with NIFTI! (has 32k limit; surfaces could be more) FreeSurfer can read: DICOM, Siemens IMA, AFNI How to Get Started Use dicoms from scanner as input to Cortical Reconstruction command: recon-all -all -s <subject> must do for each subject. Come back in 30 hours … Check your results – accurate to the tissue boundaries?
Transcript
Page 1: FreeSurfer Why use FreeSurfer? What happens? How do I do ... · • FreeSurfer can read/write: NIFTI, Analyze, MINC Careful with NIFTI! (has 32k limit; surfaces could be more) •

1

FreeSurferhttp://surfer.nmr.mgh.harvard.edu

RegisterDownload

Platforms: Linux and Mac

[email protected]

Why use FreeSurfer?What happens?

How do I do that?Now What?

Surface and Volume Analysis

Cortical Reconstructionand Automatic Labeling

Inflation and FunctionalMapping

Surface FlatteningSurface-based IntersubjectAlignment and Statistics

Automatic SubcorticalGray Matter Labeling

Automatic Gyral White Matter Labeling

Cortical Surface ReconstructionFreeSurfer creates computerized

models of the brain from MRI data.

Input:T1-weighted (MPRAGE,SPGR)

1mm3 resolution(.dcm)

Output:Segmented & parcellated conformed

volume(.mgz)

MGZ File Format

001.mgz• mgz = compressed MGH file• Can store 4D (like NIFTI)• cols, rows, slices, frames• Generic: volumes and surfaces

• Eg, Typical Anatomical volume: 256 x 256 x 128 x 1

• FreeSurfer can read/write:NIFTI, Analyze, MINC Careful with NIFTI! (has 32k limit; surfaces could be more)

• FreeSurfer can read:DICOM, Siemens

IMA, AFNI

How to Get Started

Use dicoms from scanner as input to Cortical Reconstruction command:

recon-all -all -s <subject>

must do for each subject.

Come back in 30 hours …Check your results – accurate to the tissue

boundaries?

Page 2: FreeSurfer Why use FreeSurfer? What happens? How do I do ... · • FreeSurfer can read/write: NIFTI, Analyze, MINC Careful with NIFTI! (has 32k limit; surfaces could be more) •

2

Output of Cortical Surface Reconstruction What Happens During Cortical Surface Reconstruction?

• Finds wm/gray boundary – white surface• Finds pial/CSF boundary – pial surface• Subcortical Segmentation• Cortical Parcellation• Generates surface-based cross-subject

registration

What Happens During Cortical Surface Reconstruction?

• Finds wm/gray boundary – white surface

one sliceentire brain

What Happens During Cortical Surface Reconstruction?

• Finds pial/CSF boundary – pial surface

one sliceentire brain

Surface Model

• Mesh of triangles gives a measurable size

• Allows us to measure Area, Curv., Thickness (distance b/w vertices)

• Vertex = point of 6 triangles• Triangles/Faces ~ 150,000 per hemi• 1:1 correspondence of vertices• XYZ at each vertex

Cortical Thickness-autorecon2-finalsurfs

Page 3: FreeSurfer Why use FreeSurfer? What happens? How do I do ... · • FreeSurfer can read/write: NIFTI, Analyze, MINC Careful with NIFTI! (has 32k limit; surfaces could be more) •

3

What Happens During Cortical Surface Reconstruction?

• Subcortical Segmentation

Caudate

Pallidum

Putamen

AmygdalaHippocampus

Lateral Ventricle

Thalamus

White MatterCortex

What Happens During Cortical Surface Reconstruction?

• Cortical ParcellationPrecentral Gyrus Postcentral Gyrus

Superior Temporal Gyrus

What Happens During Cortical Surface Reconstruction?

• Finds white/gray boundary – wm surface• Finds pial/CSF boundary – pial surface• Subcortical Segmentation• Cortical Parcellation• Generates surface-based cross-subject

registration

Why FreeSurfer• Why Surface-based Analysis?

– Function has surface-based organization– Visualization: Inflation/Flattening– Cortical Morphometric Measures– Inter-subject registration

• Automatically generated ROI tuned to each subject individually

Use FreeSurfer Be Happy

Why Is a Model of the Cortical Surface Useful?

Local functional organization of cortex is largely 2-dimensional! Eg, functional mapping of primary visual areas:

From (Sereno et al, 1995, Science).

Even if you don’t care about the anatomy, anatomical models allow functional analysis not otherwise possible.

*Also, smooth along surface

Why use FreeSurfer?What happens?

How do I do that?Now What?

Page 4: FreeSurfer Why use FreeSurfer? What happens? How do I do ... · • FreeSurfer can read/write: NIFTI, Analyze, MINC Careful with NIFTI! (has 32k limit; surfaces could be more) •

4

Individual StepsVolumetric Processing Stages (subjid/mri):1. Motion Cor, Avg, Conform (orig.mgz)2. Non-uniform inorm (nu.mgz)3. Talairach transform computation

(talairach/talairach.xfm)4. Intensity Normalization 1 (T1.mgz)5. Skull Strip (brainmask.mgz)

6. EM Register (linear volumetric registration)7. CA Intensity Normalization (norm.mgz)8. CA Non-linear Volumetric Registration 9. CA Label (Volumetric Labeling) (aseg.mgz)

10. Intensity Normalization 2 (T1.mgz)11. White matter segmentation (wm.mgz)12. Edit WM With ASeg13. Fill and cut (filled.mgz)

Surface Processing Stages (subjid/surf):14. Tessellate (?h.orig.nofix)15. Smooth1 16. Inflate117. QSphere (?h.qsqhere)18. Automatic Topology Fixer (?h.orig)19. Final Surfs (?h.white ?h.pial ?.thickness)20. Smooth2 (?h.smoothwm)21. Inflate2 (?h.inflated)22. Aseg Statistics (stats/aseg.stats)23. Cortical Ribbon Mask (?h.ribbon.mgz)

24. Spherical Morph25. Spherical Registration (?h.sphere.reg)26. Map average curvature to subject27. Cortical Parcellation (Labeling) 28. Cortical Parcellation Statistics29. Cortical Parcellation mapped to Aseg30. White Matter Parcellation (wmparc.mgz)

recon-all -help Note: ?h.orig means lh.orig or rh.orig

Blue = Manual Intervention

Reconstruction Stages

recon-all is broken into three stages– autorecon1– autorecon2– autorecon3

these 3 stages are equivalent to -all

-autorecon1Volumetric Processing Stages (subjid/mri):1. Motion Cor, Avg, Conform (orig.mgz)2. Non-uniform inorm (nu.mgz)3. Talairach transform computation

(talairach/talairach.xfm)4. Intensity Normalization 1 (T1.mgz)5. Skull Strip (brainmask.mgz)

6. EM Register (linear volumetric registration)7. CA Intensity Normalization (norm.mgz)8. CA Non-linear Volumetric Registration 9. CA Label (Volumetric Labeling) (aseg.mgz)

10. Intensity Normalization 2 (T1.mgz)11. White matter segmentation (wm.mgz)12. Edit WM With ASeg13. Fill and cut (filled.mgz)

Surface Processing Stages (subjid/surf):14. Tessellate (?h.orig.nofix)15. Smooth1 16. Inflate117. QSphere (?h.qsqhere)18. Automatic Topology Fixer (?h.orig)19. Final Surfs (?h.white ?h.pial ?.thickness)20. Smooth2 (?h.smoothwm)21. Inflate2 (?h.inflated)22. Aseg Statistics (stats/aseg.stats)23. Cortical Ribbon Mask (?h.ribbon.mgz)

24. Spherical Morph25. Spherical Registration (?h.sphere.reg)26. Map average curvature to subject27. Cortical Parcellation (Labeling) 28. Cortical Parcellation Statistics29. Cortical Parcellation mapped to Aseg30. White Matter Parcellation (wmparc.mgz)

recon-all -help

Motion Correction and Averaging

001.mgz

002.mgz

+ rawavg.mgz

orig

001.mgz 002.mgz

mri

rawavg.mgzDoes not change native resolution.

-autorecon1-motioncor

mri_motion_correct.fsl

Conform

Changes to 256^3, 1mm^3All volumes will be conformed.

rawavg.mgz orig.mgz

orig Volume

-autorecon1-motioncor

mri_convert -conform

Non-Uniform Intensity Correction

• Uses MNI tool• Removes B1 bias field

-nuintensitycor -autorecon1

nu Volumemri_nu_correct.mni

Page 5: FreeSurfer Why use FreeSurfer? What happens? How do I do ... · • FreeSurfer can read/write: NIFTI, Analyze, MINC Careful with NIFTI! (has 32k limit; surfaces could be more) •

5

Talairach Transform

• Computes 12 DOF transform matrix• Does NOT resample• MNI305 template• Used to report Talairach coords in papers• mri/transforms/talairach.xfm

mri

transforms

talairach.xfm

-autorecon1-talairach

talairach_avi

Intensity Normalization

• Presegmentation (T1.mgz)– All WM = 110 intensity– Pre- and Post-Skull

Strip

T1 Volume

-autorecon1-normalization

mri_normalize

Skull Strip

• Removes all non-brain– Skull, Eyes, Neck, Dura

• brainmask.mgz

Orig Volume Brainmask Volume

-autorecon1-skullstrip

mri_watershed

FreeSurfer Directory Tree

Subject ID

Each data set has its own unique SubjectId (eg, bert)

bert

bem stats src mri scripts surf tmp label trash

orig T1 brainmask wm aseg aparc+aseg wmparc

-autorecon2Volumetric Processing Stages (subjid/mri):1. Motion Cor, Avg, Conform (orig.mgz)2. Non-uniform inorm (nu.mgz)3. Talairach transform computation

(talairach/talairach.xfm)4. Intensity Normalization 1 (T1.mgz)5. Skull Strip (brainmask.mgz)

6. EM Register (linear volumetric registration)7. CA Intensity Normalization (norm.mgz)8. CA Non-linear Volumetric Registration 9. CA Label (Volumetric Labeling) (aseg.mgz)

10. Intensity Normalization 2 (T1.mgz)11. White matter segmentation (wm.mgz)12. Edit WM With ASeg13. Fill and cut (filled.mgz)

Surface Processing Stages (subjid/surf):14. Tessellate (?h.orig.nofix)15. Smooth1 16. Inflate117. QSphere (?h.qsqhere)18. Automatic Topology Fixer (?h.orig)19. Final Surfs (?h.white ?h.pial ?.thickness)20. Smooth2 (?h.smoothwm)21. Inflate2 (?h.inflated)22. Aseg Statistics (stats/aseg.stats)23. Cortical Ribbon Mask (?h.ribbon.mgz)

24. Spherical Morph25. Spherical Registration (?h.sphere.reg)26. Map average curvature to subject27. Cortical Parcellation (Labeling) 28. Cortical Parcellation Statistics29. Cortical Parcellation mapped to Aseg30. White Matter Parcellation (wmparc.mgz)

recon-all -help Note: lh processed completely first, then rh.

Automatic Volume Labeling

• Label subcortical structures and wm/gm

•Determine volumes of subcortical structures

•Used to fill in subcortical structures for later steps

ASeg Volume

Atlas: RB_all_2007-08-08

-autorecon2-subcortseg

steps 6-9, 22

Page 6: FreeSurfer Why use FreeSurfer? What happens? How do I do ... · • FreeSurfer can read/write: NIFTI, Analyze, MINC Careful with NIFTI! (has 32k limit; surfaces could be more) •

6

Volume-based Labeling

0 20 40 60 80 100 1200

2

4

6

8

10

intensity

% v

oxe

ls in

lab

el

WMGMlVThCaPuPaHpAm

Labeling is determined by location and intensity.

-autorecon2-subcortseg

ICBM Atlas

Why not just register to an ROI Atlas?

12 DOF(Affine)

Subject 1Subject 2 aligned with Subject 1

(Subject 1’s Surface)

Problems with Affine (12 DOF) Registration

Markov Random Field: Motivation

What is the probability that cortical gray matter occurs inferior to hippocampus?

0 20 40 60 80 100 1200

2

4

6

8

10

intensity

% v

oxe

ls in

lab

el

WMGMlVThCaPuPaHpAm

Can’t segment on intensity alone

ICBM Atlas

12 DOF(Affine)

Why not just register to an ROI Atlas?

Problems with Affine (12 DOF) Registration• ROIs need to be individualized.

Why we use atlas + intensity + spatial location + geometric info + neighboring voxels + other info…

Markov Random Field: Motivation

What is the probability that cortical gray matter occurs inferior to hippocampus?

Segmentation: MRF

Preliminary Segmentation

Page 7: FreeSurfer Why use FreeSurfer? What happens? How do I do ... · • FreeSurfer can read/write: NIFTI, Analyze, MINC Careful with NIFTI! (has 32k limit; surfaces could be more) •

7

Segmentation: MRF

Final Segmentation

White Matter Segmentation• Separates white matter from everything else• “Fills in” subcortical structures• Cerebellum removed, brain stem still there

wm Volume

-autorecon2-segmentation

mri_segment

mri_edit_wm_with_aseg

mri_pretess

Fill and Cut (Subcortical Mass)• Fills in any voids• Removes any islands• Removes brain stem• Separates hemispheres (each hemi has different value) • filled.mgz = “Subcortical Mass”

WM Volume Filled Volume

-autorecon2-fill

mri_fill

FreeSurfer Directory Tree

Subject ID

Each data set has its own unique SubjectId (eg, bert)

bert

bem stats src mri scripts surf tmp label trash

orig T1 brainmask wm aseg aparc+aseg wmparc

Tessellation

• Mosaic of triangles (“tessellation”)• Errors: Donut holes, handles

- Subsequently fixed by the automatic topology fixer

orig surface surf/lh.origsurf/rh.orig

-autorecon2-tessellation

Inflation: Visualization

Dale and Sereno, 1993; Dale et al., Dale et al., 1999; Fischl et al., 1999; Fischl et al., 2000; Fischl et al., 2001

Gyri

Sulci

-autorecon2-inflate

Page 8: FreeSurfer Why use FreeSurfer? What happens? How do I do ... · • FreeSurfer can read/write: NIFTI, Analyze, MINC Careful with NIFTI! (has 32k limit; surfaces could be more) •

8

Automatic Topology Fixer

Fornix

Pallidum and Putamen

hippocampus

Ventricles and Caudate

Cortical Defects

• Holes• Handles• Automatically Fixed

optic nerve

-autorecon2-fix

Manifold Surgery

BEFORE AFTER

White Matter Surface• Nudge orig surface• Follow T1 intensity gradients• Smoothness constraint• Vertex Identity stays constant

-autorecon2-finalsurfs

Pial Surface

• Nudge white surface• Follow T1 intensity gradients• Vertex Identity Stays

-autorecon2-finalsurfs

Optimal Surface Placement

Gray-White Boundary

Outer Cortical Surface

-autorecon2-finalsurfs

Cortical Thickness

white/gray surface

pial surface

lh.thickness, rh.thickness

• Distance between white and pial surfaces

• One value per vertex• Surface-based more

accurate than volume-based

Page 9: FreeSurfer Why use FreeSurfer? What happens? How do I do ... · • FreeSurfer can read/write: NIFTI, Analyze, MINC Careful with NIFTI! (has 32k limit; surfaces could be more) •

9

Thickness Maps• Red regions are thinner• Yellow regions are thicker

Curvature (Radial)• Circle tangent to surface

at each vertex• Curvature measure is

1/radius of circle• One value per vertex• Signed (sulcus/gyrus)• Actually use gaussian

curvature

lh.curv, rh.curv

FreeSurfer Directory Tree

Subject ID

Each data set has its own unique SubjectId (eg, bert)

bert

bem stats src mri scripts surf tmp label

lh.white lh.curv lh.thickness lh.pial

-autorecon3Volumetric Processing Stages (subjid/mri):1. Motion Cor, Avg, Conform (orig.mgz)2. Non-uniform inorm (nu.mgz)3. Talairach transform computation

(talairach/talairach.xfm)4. Intensity Normalization 1 (T1.mgz)5. Skull Strip (brainmask.mgz)

6. EM Register (linear volumetric registration)7. CA Intensity Normalization (norm.mgz)8. CA Non-linear Volumetric Registration 9. CA Label (Volumetric Labeling) (aseg.mgz)

10. Intensity Normalization 2 (T1.mgz)11. White matter segmentation (wm.mgz)12. Edit WM With ASeg13. Fill and cut (filled.mgz)

Surface Processing Stages (subjid/surf):14. Tessellate (?h.orig.nofix)15. Smooth1 16. Inflate117. QSphere (?h.qsqhere)18. Automatic Topology Fixer (?h.orig)19. Final Surfs (?h.white ?h.pial ?.thickness)20. Smooth2 (?h.smoothwm)21. Inflate2 (?h.inflated)22. Aseg Statistics (stats/aseg.stats)23. Cortical Ribbon Mask (?h.ribbon.mgz)

24. Spherical Morph25. Spherical Registration (?h.sphere.reg)26. Map average curvature to subject27. Cortical Parcellation (Labeling) 28. Cortical Parcellation Statistics29. Cortical Parcellation mapped to Aseg30. White Matter Parcellation (wmparc.mgz)

recon-all -help Note: lh processed completely first, then rh.

Surface-Based Spherical Coord System “Spherical” Registration

Spherical Inflation

High-DimensionalRegistration toSpherical Template

Template: average.curvature.filled.buckner.40.tiff

Inflated Surface (Sulcal Map)

Atlas (Target)

Individual Subject

Page 10: FreeSurfer Why use FreeSurfer? What happens? How do I do ... · • FreeSurfer can read/write: NIFTI, Analyze, MINC Careful with NIFTI! (has 32k limit; surfaces could be more) •

10

Spherical InflationRegistration to Atlas

-autorecon3-sphere-surfreg

Atlas (Target)

Individual Subject

Cortical Parcellation

Fine-tune based onindividual anatomy

Spherical Template based on Manual Parcellation

Map to IndividualThru Spherical Reg

Atlases: curvature.buckner40filled.desikan_killiany, atlas_2005_simple

-autorecon3-cortparc

Non-Cortical Areas of Surface

Amygdala, Putamen, Hippocampus, Caudate, Ventricles, CC

Amygdala

?h.cortex.label

The “Unknown” Label

Cortical Parcellation: 2

AutomaticManual

Atlases: curvature.buckner40filled.desikan_killiany, atlas_2005_simple

Thanks to Christophe Destrieux for this slide.

-cortparc2 -autorecon3

Aparc+Aseg

There is also aparc.a2005s+aseg.mgz for Destrieux atlas

-aparc2aseg -autorecon3

Page 11: FreeSurfer Why use FreeSurfer? What happens? How do I do ... · • FreeSurfer can read/write: NIFTI, Analyze, MINC Careful with NIFTI! (has 32k limit; surfaces could be more) •

11

White Matter Parcellation

Salat DH, Greve DN, Pacheco JL, Quinn BT, Helmer KG, Buckner RL,Fischl B. Regional white matter volume differences in nondemented aging and Alzheimer’s disease. Neuroimage. 2008 Nov 5.

-wmparc -autorecon3

Nearest Cortical Labelto point in White Matter

FreeSurfer Directory Tree

Subject ID

Each data set has its own unique SubjectId (eg, bert)

bert

bem stats src mri scripts surf tmp label

lh.aparc.annot rh.aparc.annot

FreeSurfer Directory Tree

Subject ID

Each data set has its own unique SubjectId (eg, bert)

bert

bem stats src mri scripts surf tmp label

orig T1 brainmask wm aseg aparc+aseg wmparc

FreeSurfer Directory Tree

Subject ID

Directories used often are in green.

bert

bem stats src mri scripts surf tmp label trash

aseg.stats lh.aparc.stats rh.aparc.stats wmparc.stats

Why use FreeSurfer?What happens?

How do I do that?Now What?

Starting the Reconstruction Process

recon-all \-i /path/to/your/raw/data1 \-i /path/to/your/raw/data2 \-all -s subject_id

• This will create the subject directory ‘subject_id’ in your $SUBJECTS_DIR and convert your 2 raw acquisitions to mgz and use them as input for the ‘-all’ command.

Before running FreeSurfer, must set $FREESURFER_HOME and $SUBJECTS_DIR

Page 12: FreeSurfer Why use FreeSurfer? What happens? How do I do ... · • FreeSurfer can read/write: NIFTI, Analyze, MINC Careful with NIFTI! (has 32k limit; surfaces could be more) •

12

Set-up Environmental Variables

bert

$SUBJECTS_DIR

fred sara margaret …

Subject ID

Before running FreeSurfer, must set $FREESURFER_HOME and

$SUBJECTS_DIR

FreeSurfer Directory Tree

Subject ID

Each data set has its own unique SubjectId (eg, bert)

bert

bem stats src mri scripts surf tmp label trash touch

Alternative: Add Your Data• cd $SUBJECTS_DIR• mkdir –p bert/mri/orig• mri_convert yourdicom.dcm bert/mri/orig/001.mgz• mri_convert yourdicom.dcm bert/mri/orig/002.mgz• recon-all –all –s bert

bert

bem label src mri scripts surf tmp label

orig001.mgz 002.mgz

FreeSurfer Output

• Volumes• Surfaces• Surface Overlays• ROI Summaries

Volumes

orig.mgz

• $SUBJECTS_DIR/bert/mri• All “Conformed” 256^3, 1mm• File format: .mgz

aseg.mgz

T1.mgz brainmask.mgz wm.mgz filled.mgzSubcortical Mass

aparc+aseg.mgzVolume Viewer:tkmedit

Surfaces

.orig .white .pial

.inflated sphere, sphere.reg flat• $SUBJECTS_DIR/bert/surf•Number/Identity of vertices stays the same (except flat)•XYZ Location Changes•Flattening not done as part of standard reconstruction

Surface Viewer:tksurfer

Page 13: FreeSurfer Why use FreeSurfer? What happens? How do I do ... · • FreeSurfer can read/write: NIFTI, Analyze, MINC Careful with NIFTI! (has 32k limit; surfaces could be more) •

13

Surface Overlays

• Value for each vertex• Color indicates value• Color: gray,red/green, heat, color table• Rendered on any surface• fMRI/Stat Maps too

lh.sulc on inflated lh.curv on inflated lh.thickness on inflated

lh.sulc on pial

lh.aparc.annot on inflated

lh.curv on inflated fMRI on flat

Other FreeSurfer File FormatsUnique to FreeSurfer

•Surface: lh.white, lh.pial, lh.orig

• Curv: lh.curv, lh.sulc, lh.thickness

• Annotation: lh.aparc.annot

• Label: lh.pericalcarine.label

ROI Summaries:$SUBJECTS_DIR/subjid/stats

aseg.stats – volume summaries?h.aparc.stats – desikan/killiany atlas summaries?h.aparc.a2005s.stats – destrieux atlas summarieswmparc.stats – volume summaries

_______________________________________________aseg:• volumes of subcortical structures (mm3)

aparc:• thickness of cortical parcellation structures (mm)• total white matter volume (mm3) • number of vertices in cortex• surface area of cortex (mm2)

Aseg Stats FileIndex SegId NVoxels Volume_mm3 StructName Mean StdDev Min Max Range

1 2 255076 255076.0 Left-Cerebral-White-Matter 101.5872 7.9167 34.0000 148.0000 114.0000 2 3 266265 266265.0 Left-Cerebral-Cortex 75.3682 9.4016 28.0000 152.0000 124.0000 3 4 5855 5855.0 Left-Lateral-Ventricle 37.7920 10.9705 20.0000 88.0000 68.0000 4 5 245 245.0 Left-Inf-Lat-Vent 56.4091 9.5906 26.0000 79.0000 53.0000 5 7 16357 16357.0 Left-Cerebellum-White-Matter 91.2850 4.8989 49.0000 106.0000 57.0000 6 8 60367 60367.0 Left-Cerebellum-Cortex 76.3620 9.5724 26.0000 135.0000 109.0000 7 10 7460 7460.0 Left-Thalamus-Proper 91.3778 7.4668 43.0000 108.0000 65.0000 8 11 3133 3133.0 Left-Caudate 78.5801 8.2886 42.0000 107.0000 65.0000 9 12 5521 5521.0 Left-Putamen 86.9680 5.5752 66.0000 106.0000 40.0000

10 13 1816 1816.0 Left-Pallidum 97.7162 3.4302 79.0000 106.0000 27.0000 11 14 852 852.0 3rd-Ventricle 41.9007 11.8230 22.0000 69.0000 47.0000 12 15 1820 1820.0 4th-Ventricle 39.7053 10.6407 20.0000 76.0000 56.0000 13 16 25647 25647.0 Brain-Stem 85.2103 8.2819 38.0000 106.0000 68.0000 14 17 4467 4467.0 Left-Hippocampus 77.6346 7.5845 45.0000 107.0000 62.0000 15 18 1668 1668.0 Left-Amygdala 74.5104 5.8320 50.0000 94.0000 44.0000 16 24 1595 1595.0 CSF 52.1348 11.6113 29.0000 87.0000 58.0000

Index: nth Segmentation in stats fileSegId: index into lookup tableNVoxels: number of Voxels/Vertices in segmentationStructName: Name of structure from LUTMean/StdDev/Min/Max/Range: intensity across ROI

Eg: aseg.stats, wmparc.statscreated by mri_segstats

Getting Stats into Table Format

asegstats2table \ Command name--subjects 001 002 003 \ List subjects to include--meas vol \ vol or mean intensity of struct--t asegstats.txt text output file

asegstats.txt created in SUBJECTS_DIR

Using Excel: File > Open Select asegstats.txtChoose space as delimiter

Parcellation Stats File

StructName: Name of structure/ROINumVert: number of vertices in ROISurfArea: Surface area in mm2GrayVol: volume of gray matter ThickAvg/ThickStd – average and stddev of thickness in ROIMeanCurv – mean Gaussian curvatureGausCurv – Gaussian curvatureFoldInd – folding indexCurvInd – curvature index

Eg, lh.aparc.stats, lh.a2005s.aparc.statscreated by mris_anatomical_stats

StructName NumVert SurfArea GrayVol ThickAvg ThickStd MeanCurv GausCurv FoldInd CurvIndunknown 10863 7151 13207 1.776 1.629 0.121 0.107 383 50.8bankssts 1222 830 2290 2.711 0.559 0.112 0.027 10 1.3caudalanteriorcingulate 830 585 1459 2.474 0.569 0.128 0.020 10 0.7caudalmiddlefrontal 2509 1658 4979 2.653 0.567 0.125 0.035 27 3.5corpuscallosum 2124 1340 569 0.489 0.631 0.151 0.110 87 8.0cuneus 2737 1706 3086 1.741 0.509 0.162 0.065 52 8.0entorhinal 495 330 1685 3.150 0.753 0.149 0.187 15 1.5fusiform 3878 2638 7887 2.627 0.724 0.137 0.046 57 6.7

Page 14: FreeSurfer Why use FreeSurfer? What happens? How do I do ... · • FreeSurfer can read/write: NIFTI, Analyze, MINC Careful with NIFTI! (has 32k limit; surfaces could be more) •

14

Getting Stats into Table Format

aparcstats2table \ Command name--subjects 001 002 003 \ List subjects to include--h rh \ Which hemisphere--meas volume \ volume, thickness, or area--t rh.aparc.vol.txt text output file

rh.aparc.vol.txt created in SUBJECTS_DIR

Using Excel: File > Open Select asegstats.txtChoose space as delimiter

Other Info in aseg.stats• Brain – gray matter + white matter + ventricles +

hypointensities + hyperintensities• Total Gray – cortical + subcortical gray• Cortical Gray – volume between white and pial

excluding non-cortical regions.• Intracranial volume (ICV), estimated Total

Intracranial Volume (eTIV)

• Total Number of Vertices• Total Surface Area

Other Info in aparc.stats

ROI Summaries: Make Your Own

Draw your own surface label in region of interest.

Run:mris_anatomical_stats –l your_roi.label

to gets stats on that label

Some other relevant commands

• recon-all –make all –s <subjid>– reruns stream from most outdated step

• recon-all –all –clean –s <subjid>– reruns subject without using existing edits

• recon-all –all –legacy– use on data processed w/ previous version of

FS to keep prior edits• recon-all –<arg> –dontrun

– prints command to screen without executing ithttp://surfer.nmr.mgh.harvard.edu/fswiki/OtherUsefulFlags

Troubleshooting

• check recon-all.log• try to rerun step that failed • look at volume from last successful step• examine data quality to see what might cause error• if it fails again, attempt to run modified version of command

if possible• search FreeSurfer mailing list for other instances of this

problem:http://www.mail-archive.com/[email protected]/• email the mailing list if still need help

recon-all fails

FreeSurfer Directory Tree

Subject ID

Each data set has its own unique SubjectId (eg, bert)

bert

bem stats src mri scripts surf tmp label

recon-all.log recon-all-status.log

Page 15: FreeSurfer Why use FreeSurfer? What happens? How do I do ... · • FreeSurfer can read/write: NIFTI, Analyze, MINC Careful with NIFTI! (has 32k limit; surfaces could be more) •

15

Bug Reporting

• Report version currently using – see top of recon-all.log– more $FREESURFER_HOME/build-stamp.txt

• command line tried to run• attach recon-all.log• Output in terminal window if appropriate• Operating System

Why use FreeSurfer?What happens?

How do I do that?Now What?

Troubleshooting

• Skull Strip Errors• Intensity Normalization• Segmentation Errors• Topology Fixer Errors• Pial Surface• Talairach Errors

recon-all was successful but errors in volumes

MR Anatomy CaveatsSurfaces are only as good as your scan.

• Dependent on data quality– Contrast to noise– Signal to noise– Voxel resolution

• MR Artifacts– MR susceptibility– MR distortions

• Variations in MR tissue parameters across regions of the brain are altered in different populations

Cortical Reconstruction Goals

• Geometrically Accurate surfaces– Accurately follow the boundaries seen on the

scan for each of your individual subjects• Topologically Correct surfaces

– Each surface is a 2-D continuous, non self-intersecting sheet and can be inflated into a perfect sphere

Troubleshooting: Skull Strip

brainmask.mgz

–wsthresh 25 (increase to strip less; decrease to strip more)

– multistrip orig.mgz (automatically get different flood heights)

Page 16: FreeSurfer Why use FreeSurfer? What happens? How do I do ... · • FreeSurfer can read/write: NIFTI, Analyze, MINC Careful with NIFTI! (has 32k limit; surfaces could be more) •

16

Rerun Skullstrip

1. recon-all –all (Stages 1-30) ~30 hoursCheck talairach transform, skull strip, normalization Check surfaces1. Add control points: recon-all –autorecon2-cp –autorecon3

(Stages 10-30)2. Edit wm.mgz: recon-all –autorecon2-wm –autorecon3

(Stages 13-30)3. Edit brainmask.mgz: recon-all –autorecon2-pial

-autorecon3 (Stage 19-30)Note: all stages can be run individually

Intensity Normalization Failure. All WM in T1 volume (T1.mgz) should be 110.Can fix by adding “Control Points”. Beware partial voluming!

Troubleshooting: Intensity Normalization

Rerun Normalization

1. recon-all –autorecon1 (Stages 1-5) ~45 minCheck talairach transform, skull strip, normalization

2. recon-all –autorecon2 (Stages 6-23) ~20 hoursCheck surfaces

1. Add control points: recon-all –autorecon2-cp (Stages 10-23)

2. Edit wm.mgz: recon-all –autorecon2-wm (Stages 13-23)3. Edit brainmask.mgz: recon-all –autorecon2-pial (Stage

19-23)3. recon-all –autorecon3 (Stages 24-30) ~6 hours

Note: all stages can be run individually

Processing Stream Order

Eye Socket classified as WM.Skull Strip Failure.

Troubleshooting: Segmentation Error

“Hypo-Intensities”White Matter Lesions

Troubleshooting: Segmentation Error

Page 17: FreeSurfer Why use FreeSurfer? What happens? How do I do ... · • FreeSurfer can read/write: NIFTI, Analyze, MINC Careful with NIFTI! (has 32k limit; surfaces could be more) •

17

White Matter “disconnects”

Troubleshooting: Topology Fixer Error

Fill in gap or “hole”manually

White Matter “disconnects”

orig.nofix will be accurate

Troubleshooting: Topology Fixer Error

Rerun WM Segmentation

1. recon-all –autorecon1 (Stages 1-5) ~45 minCheck talairach transform, skull strip, normalization

2. recon-all –autorecon2 (Stages 6-23) ~20 hoursCheck surfaces

1. Add control points: recon-all –autorecon2-cp (Stages 10-23)

2. Edit wm.mgz: recon-all –autorecon2-wm (Stages 13-23)3. Edit brainmask.mgz: recon-all –autorecon2-pial (Stage

19-23)3. recon-all –autorecon3 (Stages 24-30) ~6 hours

Note: all stages can be run individually

White/Gray OK, butPial Inaccurate

Troubleshooting: Pial Surface Error

Rerun Final Surfaces

1. recon-all –autorecon1 (Stages 1-5) ~45 minCheck talairach transform, skull strip, normalization

2. recon-all –autorecon2 (Stages 6-23) ~20 hoursCheck surfaces

1. Add control points: recon-all –autorecon2-cp (Stages 10-23)

2. Edit wm.mgz: recon-all –autorecon2-wm (Stages 13-23)3. Edit brainmask.mgz: recon-all –autorecon2-pial (Stage

19-23)3. recon-all –autorecon3 (Stages 24-30) ~6 hours

Note: all stages can be run individually

Troubleshooting

• check recon-all.log• try to rerun step that failed • look at volume from last successful step• examine data quality to see what might cause error• if it fails again, attempt to run modified version of command

if possible• search FreeSurfer mailing list for other instances of this

problem:http://www.mail-archive.com/[email protected]/• email the mailing list if still need help

recon-all fails

Page 18: FreeSurfer Why use FreeSurfer? What happens? How do I do ... · • FreeSurfer can read/write: NIFTI, Analyze, MINC Careful with NIFTI! (has 32k limit; surfaces could be more) •

18

FreeSurfer Directory Tree

Subject ID

Each data set has its own unique SubjectId (eg, bert)

bert

bem stats src mri scripts surf tmp label

recon-all.log recon-all-status.log

Bug Reporting

• Report version currently using – see top of recon-all.log– more $FREESURFER_HOME/build-stamp.txt

• command line tried to run• attach recon-all.log• Output in terminal window if appropriate• Operating System


Recommended