Differences between revisions 11 and 12
Deletions are marked like this. Additions are marked like this.
Line 97: Line 97:
||<-5(rowbgcolor='#FF8080'>Check inflated surface and wm volume, make more edits if necessary||
||<|12(bgcolor='#FFFFE0'>["recon-all"] –stage3 -subjid subj||
||<|2(bgcolor='#FFFFE0'>-fill||<bgcolor='#E0E0FF'>wm.mgz||<|2(bgcolor='#E0E0FF'>["mri_fill"] -a ../scripts/ponscc.cut.log -xform transforms/talairach.xfm -segmentation aseg.mgz wm.mgz filled.mgz||<bgcolor='#E0E0FF'>filled.mgz||
||<rowbgcolor='#E0E0FF'>aseg.mgz||../scripts/ponscc.cut.log||
||<|2((bgcolor='#FFFFE0'>-tessellate||<|2(bgcolor='#E0E0FF'>filled.mgz||<bgcolor='#E0E0FF'>["mri_tessellate"] filled.mgz 255 ../surf/lh.orig||<bgcolor='#E0E0FF'>lh.orig||
||<rowbgcolor='#E0E0FF'>["mri_tessellate"] filled.mgz 128 ../surf/rh.orig||rh.orig||
||<bgcolor='#FFFFE0'>-smooth1||<bgcolor='#E0E0FF'>?h.orig||<bgcolor='#E0E0FF'>["mris_smooth"] ?h.orig ?h.smoothwm||<bgcolor='#E0E0FF'>?h.smoothwm||
||<bgcolor='#FFFFE0'>-inflate1||<bgcolor='#E0E0FF'>?h.smoothwm||<bgcolor='#E0E0FF'>["mris_inflate"] ?h.smoothwm ?h.inflated||<bgcolor='#E0E0FF'>?h.inflated||
||<bgcolor='#FFFFE0'>-qsphere||<bgcolor='#E0E0FF'>?h.inflated||<bgcolor='#E0E0FF'>["mris_sphere"] -w 0 -inflate -in 200 -q ?h.inflated ?h.qsphere||<bgcolor='#E0E0FF'>?h.qsphere||
||<bgcolor='#FFFFE0'>-fix||<bgcolor='#E0E0FF'>?h.qsphere||<bgcolor='#E0E0FF'>["mris_fix_topology"] subj ?h||<bgcolor='#E0E0FF'>?h.orig||
||<bgcolor='#FFFFE0'>-euler||<bgcolor='#E0E0FF'>?h.orig||<bgcolor='#E0E0FF'>["mris_euler_number"] ?h.orig||<bgcolor='#E0E0FF'>?h.orig.euler||
||<bgcolor='#FFFFE0'>-smooth2||<bgcolor='#E0E0FF'>?h.orig||<bgcolor='#E0E0FF'>["mris_smooth"] ?h.orig ?h.smoothwm||<bgcolor='#E0E0FF'>?h.smoothwm||
||<bgcolor='#FFFFE0'>-inflate2||<bgcolor='#E0E0FF'>?h.smoothwm||<bgcolor='#E0E0FF'>["mris_inflate"] ?h.smoothwm ?h.inflated||<bgcolor='#E0E0FF'>?h.inflated||
||<|7(bgcolor='#FFFFE0'>["recon-all"] –stage4a -subjid subj||
||<|3(bgcolor='#FFFFE0'>-finalsurfs||<bgcolor='#E0E0FF'>brain.mgz||<|3(bgcolor='#E0E0FF'>["mris_make_surfaces"] -w 0 subj ?h||<bgcolor='#E0E0FF'>?h.white||
||<|2(rowbgcolor='#E0E0FF'>?h.orig||?h.pial||
||<rowbgcolor='#E0E0FF'>?h.thickness||
||<|3(bgcolor='#FFFFE0'>-cortribbon||<bgcolor='#E0E0FF'>orig.mgz||<|3(bgcolor='#E0E0FF'>["mri_surf2vol"] --mkmask --hemi ?h --fillribbon --template orig.mgz --volregidentity subj --outvol ?h.ribbon.mgz||<|3(bgcolor='#E0E0FF'>?h.ribbon.mgz||
||<rowbgcolor='#E0E0FF'>?h.white||
||<rowbgcolor='#E0E0FF'>?h.pial||
||<|7(bgcolor='#FFFFE0'>["recon-all"] –stage4b -subjid subj||
||<bgcolor='#FFFFE0'>-sphere||<bgcolor='#E0E0FF'>?h.inflated||<bgcolor='#E0E0FF'>["mris_sphere"] -w 0 ?h.inflated ?h.sphere||<bgcolor='#E0E0FF'>?h.sphere||
||<bgcolor='#FFFFE0'>-surfreg||<bgcolor='#E0E0FF'>?h.sphere||<bgcolor='#E0E0FF'>["mris_register"] -w 0 -curv ?h.sphere $AvgTif ?h.sphere.reg||<bgcolor='#E0E0FF'>?h.sphere.reg||
||<|2(bgcolor='#FFFFE0'>-contrasurfreg||<bgcolor='#E0E0FF'>rh.sphere||<bgcolor='#E0E0FF'>["mris_register"] -w 0 -curv -reverse rh.sphere $AvgTif rh.lh.sphere.reg||<bgcolor='#E0E0FF'>rh.lh.sphere.reg||
||<rowbgcolor='#E0E0FF'>lh.sphere||["mris_register"] -w 0 -curv -reverse lh.sphere $AvgTif lh.rh.sphere.reg||lh.rh.sphere.reg||
||<bgcolor='#FFFFE0'>-avgcurv||<bgcolor='#E0E0FF'>?h.sphere.reg||<bgcolor='#E0E0FF'>["mrisp_paint"] -a 5 $AvgTif#6 ?h.sphere.reg ?h.avg_curv||<bgcolor='#E0E0FF'>?h.avg_curv||

[wiki:FreeSurferWorkFlows top] | [wiki:TroubleshootingReconstruction previous] | [wiki:SubcorticalSegmentation next]

FreeSurfer Historical Reconstruction Work Flow

1. source your_freesurfer_dir/SetUpFreeSurfer.csh

2. setenv SUBJECTS_DIR your_subjects_dir

3. mksubjdirs your_subject_name`

4. 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

5. a.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 --conformyour_subject_name/mri/rawavg.mgz your_subject_name/mri/orig.mgz

  • b.If you have a single scan, conform the volume to 1 mm^3 and 256x256x256:

mri_convert --conformyour_subject_name/mri/orig/002.mgz your_subject_name/mri/orig.mgz

6. recon-all -stage1 -subjid your_subject_name

7. Check the talairach transform:

  1. 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

8. Check the skull strip:

9. Edit the wm.mgz volume

  • For instructions on editing the wm.mgz, refer to:
  • FsTutorial/

10. recon-all -stage2 -subjid your_subject_name

11. (Possibly make more edits to wm.mgz volume)

12. recon-all -stage3 -stage4a -stage4b ?!!!!-avgtif -gcs!!!!?  -subjid your_subject_name

13. Check the white and pial surfaces:

Note: these Tutorial sections show data processed using Basic workflow, so large defects were autofilled.

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

HistoricalReconstruction (last edited 2021-09-22 11:45:30 by DevaniCordero)