Deletions are marked like this. | Additions are marked like this. |
Line 4: | Line 4: |
1. '''`source `''your_freesurfer_dir''`/SetUpFreeSurfer.csh`''' |
1. Source the correct version of FreeSurfer: '''`source `''your_freesurfer_dir''`/SetUpFreeSurfer.csh`''' |
Line 6: | Line 7: |
2. '''`setenv SUBJECTS_DIR `''your_subjects_dir''''' |
2. Set your SUBJECTS_DIR variable to your subjects directory: '''`setenv SUBJECTS_DIR `''your_subjects_dir''''' |
Line 8: | Line 10: |
3. '''`mksubjdirs `''your_subject_name'' ''' |
3. Make a subjects directory within your SUBJECTS_DIR: '''`mksubjdirs `''your_subject_name'' ''' |
Line 10: | Line 13: |
4. '''`mri_convert `''your_dicom_file'' ''your_subject_name''`/mri/orig/001.mgz`''' |
4. Convert the DICOM files to .mgz files in the $SUBJECTS_DIR/your_subjects_name/mri/orig directory: '''`mri_convert `''your_dicom_file'' ''your_subject_name''`/mri/orig/001.mgz`''' |
Line 12: | Line 16: |
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: |
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`''' |
Line 17: | Line 19: |
'''`mri_motion_correct2 -i `''your_subject_name''`/mri/orig/001.mgz` \''' |
5. 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`''' |
Line 19: | Line 22: |
'''-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`''' 6. '''`recon-all -stage1 -subjid `''your_subject_name''''' |
6. Start the recon-all script: '''`recon-all -stage1 -subjid `''your_subject_name''''' |
[wiki:FreeSurferWorkFlows top] | [wiki:TroubleshootingReconstruction previous] | [wiki:SubcorticalSegmentation next]
FreeSurfer Historical Reconstruction Work Flow
Source the correct version of FreeSurfer:
source your_freesurfer_dir/SetUpFreeSurfer.csh
- Set your SUBJECTS_DIR variable to your subjects directory:
setenv SUBJECTS_DIR your_subjects_dir
- Make a subjects directory within your SUBJECTS_DIR:
mksubjdirs your_subject_name
- Convert the DICOM files to .mgz files in the $SUBJECTS_DIR/your_subjects_name/mri/orig directory:
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 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
- Start the recon-all script:
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 |