Deletions are marked like this. | Additions are marked like this. |
Line 4: | Line 4: |
1. '''`source `''your_freesurfer_dir''`/SetUpFreeSurfer.csh`''' | 1. '''`source `''your_freesurfer_dir''`/SetUpFreeSurfer.csh`''' |
Line 6: | Line 6: |
2. '''`setenv SUBJECTS_DIR `''your_subjects_dir''''' | 2. '''`setenv SUBJECTS_DIR `''your_subjects_dir''''' |
Line 8: | Line 8: |
3. '''`mksubjdirs `''your_subject_name''`''' | 3. '''`mksubjdirs `''your_subject_name'' ''' |
Line 10: | Line 10: |
4. '''`mri_convert `''your_dicom_file'' ''your_subject_name''`/mri/orig/001.mgz`''' | 4. '''`mri_convert `''your_dicom_file'' ''your_subject_name''`/mri/orig/001.mgz`''' |
Line 12: | Line 12: |
If you have multiple scans from the same session, convert additional scans like: '''`mri_convert `''your_other_dicom_file'' ''your_subject_name''`/mri/orig/002.mgz`''' |
If you have multiple scans from the same session, convert additional scans like: '''`mri_convert `''your_other_dicom_file'' ''your_subject_name''`/mri/orig/002.mgz`''' 5. 5.1 If you have multiple scans from the same session, motion correct and average them to produce the orig.mgz volume: |
Line 15: | Line 17: |
'''`mri_motion_correct2 -i `''your_subject_name''`/mri/orig/001.mgz` \''' | |
Line 16: | Line 19: |
5. a.If you have multiple scans from the same session, motion correct and average them to produce the orig.mgz volume: | '''-i ''your_subject_name''`/mri/orig/002.mgz` \''' |
Line 18: | Line 21: |
'''`mri_motion_correct2 -i `''your_subject_name''`/mri/orig/001.mgz -i `''your_subject_name''`/mri/orig/002.mgz -o `''your_subject_name''`/mri/rawavg.mgz`''' | '''-o ''your_subject_name''`/mri/rawavg.mgz` ''' |
Line 20: | Line 23: |
'''`mri_convert --conform`''your_subject_name''`/mri/rawavg.mgz `''your_subject_name''`/mri/orig.mgz`''' | '''`mri_convert --conform `''your_subject_name''`/mri/rawavg.mgz `''your_subject_name''`/mri/orig.mgz`''' |
Line 22: | Line 25: |
b.If you have a single scan, conform the volume to 1 mm^3 and 256x256x256: | 5.2 If you have a single scan, conform the volume to 1 mm^3 and 256x256x256: |
Line 24: | Line 27: |
'''`mri_convert --conform`''your_subject_name''`/mri/orig/002.mgz `''your_subject_name''`/mri/orig.mgz`''' | '''`mri_convert --conform `''your_subject_name''`/mri/orig/002.mgz `''your_subject_name''`/mri/orig.mgz`''' |
Line 26: | Line 29: |
6. '''`recon-all -stage1 -subjid `''your_subject_name''''' | |
Line 27: | Line 31: |
6. '''`recon-all -stage1 -subjid `''your_subject_name''''' |
7. Check the talairach transform: 7.1 Make sure the talairach subject is linked to `$SUBJECTS_DIR` if not: '''`ln -s $FREESURFER_HOME/subjects/talairach $SUBJECTS_DIR/.`''' 7.2 '''`tkregister2 --mgz --s `''your_subject_name''` --fstal --surf orig`''' |
Line 29: | Line 36: |
7. Check the talairach transform: a. Make sure the talairach subject is linked to `$SUBJECTS_DIR` if not: '''`ln -s $FREESURFER_HOME/subjects/talairach $SUBJECTS_DIR/.`''' b. '''`tkregister2 --mgz --s `''your_subject_name''` --fstal --surf orig`''' |
For instructions on how to fix bad talairachs tranforms, refer to: * ["FsTutorial/Talairach"] |
Line 34: | Line 39: |
For instructions on how to fix bad talairachs tranforms, refer to: * FsTutorial/Talairach |
8. Check the skull strip: '''`tkmedit `''your_subject_name''` brain.mgz -aux T1.mgz`''' |
Line 37: | Line 42: |
8. Check the skull strip: '''`tkmedit `''your_subject_name''` brain.mgz -aux T1.mgz`''' |
For intructions on how to fix poor normalizations or skull strips, refer to: * FsTutorial/ControlPoints * FsTutorial/SkullStripTutorial |
Line 40: | Line 46: |
For intructions on how to fix poor normalizations or skull strips, refer to: * FsTutorial/ControlPoints * FsTutorial/SkullStripTutorial |
9. Edit the wm.mgz volume |
Line 44: | Line 48: |
9. Edit the wm.mgz volume |
For instructions on editing the wm.mgz, refer to: * FsTutorial |
Line 46: | Line 51: |
For instructions on editing the wm.mgz, refer to: * FsTutorial/ |
10. '''`recon-all -stage2 -subjid `''your_subject_name''''' |
Line 49: | Line 53: |
10. '''`recon-all -stage2 -subjid `''your_subject_name''''' | 11. (Possibly make more edits to wm.mgz volume) |
Line 51: | Line 55: |
11. (Possibly make more edits to wm.mgz volume) | 12. '''`recon-all -stage3 -stage4a -stage4b ?!!!!-avgtif -gcs!!!!? -subjid `''your_subject_name''''' |
Line 53: | Line 57: |
12. '''`recon-all -stage3 -stage4a -stage4b ?!!!!-avgtif -gcs!!!!? -subjid `''your_subject_name''''' |
13. Check the white and pial surfaces: '''`tkmedit `''your_subject_name''` wm.mgz rh.white -aux brain.mgz`''' |
Line 55: | Line 60: |
13. Check the white and pial surfaces: '''`tkmedit `''your_subject_name''` wm.mgz rh.white -aux brain.mgz`''' |
'''`tkmedit `''your_subject_name''` wm.mgz lh.white -aux brain.mgz`''' |
Line 58: | Line 62: |
'''`tkmedit `''your_subject_name''` wm.mgz lh.white -aux brain.mgz`''' |
For intructions on editing the final surfaces, refer to: * FsTutorial/FixingDefects * FsTutorial/PialEdits * FsTutorial/FinalSurfEx |
Line 60: | Line 67: |
For intructions on editing the final surfaces, refer to: * FsTutorial/FixingDefects * FsTutorial/PialEdits * FsTutorial/FinalSurfEx Note: these Tutorial sections show data processed using Basic workflow, so large defects were autofilled. |
Note: these Tutorial sections show data processed using Basic workflow, so large defects were autofilled. |
[wiki:FreeSurferWorkFlows top] | [wiki:TroubleshootingReconstruction previous] | [wiki:SubcorticalSegmentation next]
FreeSurfer Historical Reconstruction Work Flow
source your_freesurfer_dir/SetUpFreeSurfer.csh
setenv SUBJECTS_DIR your_subjects_dir
mksubjdirs your_subject_name
mri_convert your_dicom_file your_subject_name/mri/orig/001.mgz
- If you have multiple scans from the same session, convert additional scans like:
mri_convert your_other_dicom_file your_subject_name/mri/orig/002.mgz
- If you have multiple scans from the same session, convert additional scans like:
-
- 5.1 If you have multiple scans from the same session, motion correct and average them to produce the orig.mgz volume:
mri_motion_correct2 -i your_subject_name/mri/orig/001.mgz \
-i your_subject_name/mri/orig/002.mgz \
-o your_subject_name/mri/rawavg.mgz
mri_convert --conform your_subject_name/mri/rawavg.mgz your_subject_name/mri/orig.mgz 5.2 If you have a single scan, conform the volume to 1 mm^3 and 256x256x256:
mri_convert --conform your_subject_name/mri/orig/002.mgz your_subject_name/mri/orig.mgz
- 5.1 If you have multiple scans from the same session, motion correct and average them to produce the orig.mgz volume:
recon-all -stage1 -subjid your_subject_name
- Check the talairach transform:
7.1 Make sure the talairach subject is linked to $SUBJECTS_DIR
if not: ln -s $FREESURFER_HOME/subjects/talairach $SUBJECTS_DIR/.
7.2 tkregister2 --mgz --s your_subject_name --fstal --surf orig For instructions on how to fix bad talairachs tranforms, refer to:
- ["FsTutorial/Talairach"]
- Check the skull strip:
tkmedit your_subject_name brain.mgz -aux T1.mgz For intructions on how to fix poor normalizations or skull strips, refer to:
- Edit the wm.mgz volume For instructions on editing the wm.mgz, refer to:
recon-all -stage2 -subjid your_subject_name
- (Possibly make more edits to wm.mgz volume)
recon-all -stage3 -stage4a -stage4b ?!!!!-avgtif -gcs!!!!? -subjid your_subject_name
- Check the white and pial surfaces:
tkmedit your_subject_name wm.mgz rh.white -aux brain.mgz
tkmedit your_subject_name wm.mgz lh.white -aux brain.mgz For intructions on editing the final surfaces, refer to:
Recon-all steps and stages
recon-all step |
Individual Flag |
Input |
Command Line |
Output |
none |
none |
file.dcm |
["mri_convert"] file.dcm orig/001.mgz |
orig/001.mgz |
["recon-all"] -stage1 -subjid subj |
||||
-motioncor |
orig/001.mgz |
["mri_motion_correct2"] -i orig/001.mgz -i orig/002.mgz -o rawavg.mgz |
rawavg.mgz |
|
orig/002.mgz |
||||
rawavg.mgz |
["mri_convert"] rawavg.mgz orig.mgz --conform |
orig.mgz |
||
-nuintensitycor |
orig.mgz |
["mri_convert"] orig.mgz orig.mnc |
orig.mnc |
|
orig.mnc |
(4 iterations of) ["nu_correct"] -clobber nu0.mnc nu1.mnc |
nu4.mnc |
||
nu4.mnc |
["mri_convert"] nu4.mnc nu.mgz |
nu.mgz |
||
-talairach |
nu.mgz |
["talairach2"] subjid -mgz |
transforms/talairach.xfm |
|
-normalization |
nu.mgz |
["mri_normalize"] nu.mgz T1.mgz |
T1.mgz |
|
-skullstrip |
T1.mgz |
["mri_watershed"] T1.mgz brain.mgz |
brain.mgz |
|
-segmentation |
brain.mgz |
["mri_segment"] brain.mgz wm.mgz |
wm.mgz |
|
-fill |
wm.mgz |
["mri_fill"] -a ../scripts/ponscc.cut.log -xform transforms/talairach.xfm -segmentation aseg.mgz wm.mgz filled.mgz |
filled.mgz |
|
aseg.mgz |
../scripts/ponscc.cut.log |
|||
-tessellate |
filled.mgz |
["mri_tessellate"] filled.mgz 255 ../surf/lh.orig |
lh.orig |
|
["mri_tessellate"] filled.mgz 128 ../surf/rh.orig |
rh.orig |
|||
-smooth1 |
?h.orig |
["mris_smooth"] ?h.orig ?h.smoothwm |
?h.smoothwm |
|
-inflate1 |
?h.smoothwm |
["mris_inflate"] ?h.smoothwm ?h.inflated |
?h.inflated |
|
Check skullstrip (brain.mgz), talairach (transforms/talairach.xfm), and normalization (brain.mgz or T1.mgz - mean wm voxel value = 110). Perform manual edits to wm.mgz volume. |
||||
["recon-all"] stage2 -subjid subj |
||||
-fill |
wm.mgz |
["mri_fill"] -a ../scripts/ponscc.cut.log -xform transforms/talairach.xfm -segmentation aseg.mgz wm.mgz filled.mgz |
filled.mgz |
|
aseg.mgz |
../scripts/ponscc.cut.log |
|||
-tessellate |
filled.mgz |
["mri_tessellate"] filled.mgz 255 ../surf/lh.orig |
lh.orig |
|
["mri_tessellate"] filled.mgz 128 ../surf/rh.orig |
rh.orig |
|||
-smooth1 |
?h.orig |
["mris_smooth"] ?h.orig ?h.smoothwm |
?h.smoothwm |
|
-inflate1 |
?h.smoothwm |
["mris_inflate"] ?h.smoothwm ?h.inflated |
?h.inflated |
|
Check inflated surface and wm volume, make more edits if necessary |
||||
["recon-all"] stage3 -subjid subj |
||||
-fill |
wm.mgz |
["mri_fill"] -a ../scripts/ponscc.cut.log -xform transforms/talairach.xfm -segmentation aseg.mgz wm.mgz filled.mgz |
filled.mgz |
|
aseg.mgz |
../scripts/ponscc.cut.log |
|||
-tessellate |
filled.mgz |
["mri_tessellate"] filled.mgz 255 ../surf/lh.orig |
lh.orig |
|
["mri_tessellate"] filled.mgz 128 ../surf/rh.orig |
rh.orig |
|||
-smooth1 |
?h.orig |
["mris_smooth"] ?h.orig ?h.smoothwm |
?h.smoothwm |
|
-inflate1 |
?h.smoothwm |
["mris_inflate"] ?h.smoothwm ?h.inflated |
?h.inflated |
|
-qsphere |
?h.inflated |
["mris_sphere"] -w 0 -inflate -in 200 -q ?h.inflated ?h.qsphere |
?h.qsphere |
|
-fix |
?h.qsphere |
["mris_fix_topology"] subj ?h |
?h.orig |
|
-euler |
?h.orig |
["mris_euler_number"] ?h.orig |
?h.orig.euler |
|
-smooth2 |
?h.orig |
["mris_smooth"] ?h.orig ?h.smoothwm |
?h.smoothwm |
|
-inflate2 |
?h.smoothwm |
["mris_inflate"] ?h.smoothwm ?h.inflated |
?h.inflated |
|
["recon-all"] stage4a -subjid subj |
||||
-finalsurfs |
brain.mgz |
["mris_make_surfaces"] -w 0 subj ?h |
?h.white |
|
?h.orig |
?h.pial |
|||
?h.thickness |
||||
-cortribbon |
orig.mgz |
["mri_surf2vol"] --mkmask --hemi ?h --fillribbon --template orig.mgz --volregidentity subj --outvol ?h.ribbon.mgz |
?h.ribbon.mgz |
|
?h.white |
||||
?h.pial |
||||
["recon-all"] stage4b -subjid subj |
||||
-sphere |
?h.inflated |
["mris_sphere"] -w 0 ?h.inflated ?h.sphere |
?h.sphere |
|
-surfreg |
?h.sphere |
["mris_register"] -w 0 -curv ?h.sphere $AvgTif ?h.sphere.reg |
?h.sphere.reg |
|
-contrasurfreg |
rh.sphere |
["mris_register"] -w 0 -curv -reverse rh.sphere $AvgTif rh.lh.sphere.reg |
rh.lh.sphere.reg |
|
lh.sphere |
["mris_register"] -w 0 -curv -reverse lh.sphere $AvgTif lh.rh.sphere.reg |
lh.rh.sphere.reg |
||
-avgcurv |
?h.sphere.reg |
["mrisp_paint"] -a 5 $AvgTif#6 ?h.sphere.reg ?h.avg_curv |
?h.avg_curv |