Differences between revisions 45 and 46
Deletions are marked like this. Additions are marked like this.
Line 70: Line 70:
The following flags can be used after certain manual intervention to regenerate accurate volumes and surfaces (if a data set already has or needs spherical morphing, add the -autorecon3 flag): The following flags can be used after certain manual intervention to regenerate accurate volumes and surfaces (if a data set has or needs spherical morphing, add the -autorecon3 flag):

FreeSurfer Tutorial: Useful recon-all flags.

This page extends ReconAllDevTable. The following flags can be used in conjunction with individual steps or the entire process:

-autorecon-all

either of these flags will work to run the entire recon-all process.

-all

-dontrun

useful for debugging. just prints the commands that will run (does not execute them).

-legacy

use this flag on data that was previously processed with a different version of freesurfer. Use this flag THE FIRST TIME only. It will automatically keep all your prior edits (talairach, control points, white matter etc).

-clean-tal

trashes any manual edits to the talairach, makes talairach.xfm and talairach.auto.xfm the same and runs using the automatically generated talairach.xfm

-clean-seed

trashes all saved seed point for the cutting planes and uses the automatically set cutting planes.

-clean-cp

trashes control points and runs the normalization without control points.

-clean-bm

trashes any manual edits to the brainmask.mgz volume, makes brainmask.mgz and brainmask.auto.mgz the same and runs using the automatically generated brainmask.mgz

-clean-wm

trashes any manual edits to the wm.mgz volume and runs using the automatically generated wm.mgz.

-clean-aseg

trashes any manual edits to the aseg.mgz and runs using the automatically generated aseg.mgz

-clean-cpwm

combination of -clean-cp and -clean-wm.

-clean

use this flag to clear all of your manual edits and run it completely fresh.

-noaseg

use this flag on subjects that either cannot use an aseg (i.e., baby brains or non-human primates) or for those for which you will never want an aseg. It skips the subcortical segmentation and will not try and use it (aseg.mgz) in any of the subsequent steps.

-norandomness

use this flag on a subject when it is necessary to ensure that results are exactly the same from run to run. it seeds the random number generator used by some algorithms with the same number, removing any variability.

recon-all flag

Used with step

Input

Command Line

Output

Description

-no-ca-align

-careg

brainmask.mgz

["mri_ca_register"] -mask brainmask.mgz -T transforms/talairach.lta norm.mgz $FREESURFER_HOME/average/RB_all_2006-02-15.gca transforms/talairach.m3z

transforms/talairach.m3z

this flag should be used if the data to be processed comes from the same scanner platform and pulse sequence as the atlas. With the FreeSurfer RB40 atlas this means MPRAGE on a 1.5T Siemens scanner.

transforms/talairach.lta

norm.mgz

-calabel

norm.mgz

["mri_ca_label"] norm.mgz transforms/talairach.m3z $FREESURFER_HOME/average/RB_all_2006-02-15.gca aseg.auto.mgz

aseg.auto.mgz

transforms/talairach.m3z

aseg.auto.mgz

cp aseg.auto.mgz aseg.mgz

aseg.mgz

-subcortseg

-gcareg

brainmask.mgz

["mri_em_register"] -mask brainmask.mgz nu.mgz $FREESURFER_HOME/average/RB_all_2006-02-15.gca transforms/talairach.lta

transforms/talairach.lta

runs the subcortical segmentation and associated statistics

nu.mgz

-canorm

brainmask.mgz

["mri_ca_normalize"] -mask brainmask.mgz nu.mgz $FREESURFER_HOME/average/RB_all_2006-02-15.gca transforms/talairach.lta norm.mgz

norm.mgz

nu.mgz

transforms/talairach.lta

-careg

brainmask.mgz

["mri_ca_register"] -align -mask brainmask.mgz -T transforms/talairach.lta norm.mgz $FREESURFER_HOME/average/RB_all_2006-02-15.gca transforms/talairach.m3z

transforms/talairach.m3z

transforms/talairach.lta

norm.mgz

-rmneck

nu.mgz

["mri_remove_neck"] -radius 25 nu.mgz transforms/talairach.m3z $FREESURFER_HOME/average/RB_all_2006-02-15.gca nu_noneck.mgz

nu_noneck.mgz

transforms/talairach.m3z

-skull-lta

transforms/talairach.lta

["mri_em_register"] -skull -t transforms/talairach.lta nu_noneck.mgz $FREESURFER_HOME/average/RB_all_withskull_2006-02-15.gca transforms/talairach_with_skull.lta

transforms/talairach_with_skull.lta

nu_noneck.mgz

-calabel

norm.mgz

["mri_ca_label"] -align norm.mgz transforms/talairach.m3z $FREESURFER_HOME/average/RB_all_2006-02-15.gca aseg.auto.mgz

aseg.auto.mgz

transforms/talairach.m3z

aseg.auto.mgz

cp aseg.auto.mgz aseg.mgz

aseg.mgz

-segstats

aseg.mgz

["mri_segstats"] --seg mri/aseg.mgz --sum stats/aseg.stats --pv mri/norm.mgz --in mri/norm.mgz --ctab-default --excludeid 0 --brain-vol-from-seg --brainmask mri/brainmask.mgz --in-intensity-name orig --in-intensity-units MR --etiv --subject <subjid>

stats/aseg.stats

-cc-xyz <X Y Z>

-fill

wm.mgz

["mri_fill"] -a ../scripts/ponscc.cut.log -C X Y Z -xform transforms/talairach.xfm wm.mgz filled.mgz

filled.mgz

manually sets the corpus callosum seed point

-pons-xyz <X Y Z>

-fill

wm.mgz

["mri_fill"] -a ../scripts/ponscc.cut.log -P X Y Z -xform transforms/talairach.xfm wm.mgz filled.mgz

filled.mgz

manually sets the pons seed point

-rh-xyz <X Y Z>

-fill

wm.mgz

["mri_fill"] -a ../scripts/ponscc.cut.log -rh X Y Z -xform transforms/talairach.xfm wm.mgz filled.mgz

filled.mgz

manually sets the right hemisphere seed point

-lh-xyz <X Y Z>

-fill

wm.mgz

["mri_fill"] -a ../scripts/ponscc.cut.log -lh X Y Z -xform transforms/talairach.xfm wm.mgz filled.mgz

filled.mgz

manually sets the left hemisphere seed point

-jacobian_dist0

?h.sphere.reg

mris_register -curv -norot -jacobian ../surf/lh.jacobian -dist 0 ../surf/lh.sphere.reg $FREESURFER_HOME/average/lh.average.curvature.filled.buckner40.tif ../surf/lh.sphere.dist0.jacobian.reg

?h.jacobian_dist0

Computes how much an individual surface must be distorted in order to perfectly match the atlas (ie, distance contraints are turned off).

?h.sphere.jacobian.reg

-old-atlas

-gcareg

brain.mgz

["mri_em_register"] -mask brain.mgz -p .5 -fsamples fsamples.mgz nu.mgz $FREESURFER_HOME/average/talairach_mixed.gca transforms/talairach.lta

transforms/talairach.lta

Use this flag in conjunction with other steps of recon-all and it will default to the old set of atlases. Uses talairach_mixed.gca for the subcortical segmentation, ?h.average.tif for the surface morph, and ?h.atlas2002_simple.gcs for the cortical parcellations.

nu.mgz

-canorm

brain.mgz

["mri_ca_normalize"] -mask brain.mgz nu.mgz $FREESURFER_HOME/average/talairach_mixed.gca transforms/talairach.lta norm.mgz

norm.mgz

nu.mgz

transforms/talairach.lta

-careg

brain.mgz

["mri_ca_register"] -cross-sequence -mask brain.mgz -T transforms/talairach.lta norm.mgz $FREESURFER_HOME/average/talairach_mixed.gca transforms/talairach.m3z

transforms/talairach.m3z

transforms/talairach.lta

norm.mgz

-calabel

norm.mgz

["mri_ca_label"] -cross-sequence norm.mgz transforms/talairach.m3z $FREESURFER_HOME/average/talairach_mixed.gca aseg.mgz

aseg.mgz

transforms/talairach.m3z

-surfreg

?h.sphere

["mris_register"] -w 0 -curv ?h.sphere $FREESURFER_HOME/average?h.average.tif ?h.sphere.reg

?h.sphere.reg

-contrasurfreg

rh.sphere

["mris_register"] -w 0 -curv -reverse rh.sphere $FREESURFER_HOME/average?h.average.tif rh.lh.sphere.reg

rh.lh.sphere.reg

lh.sphere

["mris_register"] -w 0 -curv -reverse lh.sphere $FREESURFER_HOME/average?h.average.tif lh.rh.sphere.reg

lh.rh.sphere.reg

-avgcurv

?h.sphere.reg

["mrisp_paint"] -a 5 $FREESURFER_HOME/average?h.average.tif ?h.sphere.reg ?h.avg_curv

?h.avg_curv

-cortparc

?h.sphere.reg

["mris_ca_label"] -t $CPAnnotTable subj ?h sphere.reg $FREESURFER_HOME/average/?h.atlas2002_simple.gcs ?h.aparc.annot

label/?h.aparc.annot

-deface

orig.mgz

mri_deface orig.mgz $FREESURFER_HOME/average/talairach_mixed_with_skull.gca $FREESURFER_HOME/average/face.gca orig_defaced.mgz

orig_defaced.mgz

removes the face from the orig volume to anonymize it.

The following flags can be used after certain manual intervention to regenerate accurate volumes and surfaces (if a data set has or needs spherical morphing, add the -autorecon3 flag):

recon-all step

Individual Flag

Input

Command Line

Output

["recon-all"] -autorecon2-cp -subjid subj (use this after setting control points. This flag will preserve your wm.mgz edits and remake all necessary volumes and surfaces)

-normalization2

brainmask.mgz

["mri_normalize"] -mask brainmask.mgz norm.mgz brain.mgz

brain.mgz

norm.mgz

brain.mgz

["mri_mask"] brain.mgz brainmask.mgz brain.finalsurfs.mgz

brain.finalsurfs.mgz

brainmask.mgz

-segmentation

brain.mgz

["mri_segment"] brain.mgz wm.seg.mgz

wm.seg.mgz

wm.seg.mgz

["mri_edit_wm_with_aseg"] wm.seg.mgz brain.mgz aseg.mgz wm.asegedit.mgz

wm.asegedit.mgz

aseg.mgz

brain.mgz

wm.asegedit.mgz

["mri_pretess"] wm.asegedit.mgz norm.mgz wm.mgz

wm.mgz

norm.mgz

-fill

wm.mgz

["mri_fill"] -a ../scripts/ponscc.cut.log -xform transforms/talairach.lta -segmentation aseg.mgz wm.mgz filled.mgz

filled.mgz

aseg.mgz

../scripts/ponscc.cut.log

transforms/talairach.lta

-tessellate

filled.mgz

["mri_tessellate"] filled.mgz 255 ../surf/lh.orig.nofix

lh.orig.nofix

["mri_tessellate"] filled.mgz 127 ../surf/rh.orig.nofix

rh.orig.nofix

-smooth1

?h.orig.nofix

["mris_smooth"] -nw ?h.orig.nofix ?h.smoothwm.nofix

?h.smoothwm.nofix

-inflate1

?h.smoothwm.nofix

["mris_inflate"] -no-save-sulc ?h.smoothwm.nofix ?h.inflated.nofix

?h.inflated.nofix

-qsphere

?h.inflated.nofix

["mris_sphere"] -q -0 ?h.inflated.nofix ?h.inflated.nofix ?h.qsphere.nofix

?h.qsphere.nofix

-fix

?h.orig.nofix

cp ?h.orig.nofix ?h.orig

?h.orig

?h.inflated.nofix

cp ?h.inflated.nofix ?h.inflated

?h.inflated

?h.qsphere.nofix

["mris_fix_topology"] -errors -mgz -sphere qsphere.nofix -ga <subjid> ?h

?h.orig

-finalsurfs

brain.finalsurfs.mgz

["mris_make_surfaces"] -mgz -w 0 -T1 brain.finalsurfs.mgz subj ?h

?h.white

?h.pial

?h.thickness

?h.orig

?h.curv

?h.area

-smooth2

?h.white

["mris_smooth"] ?h.white ?h.smoothwm

?h.smoothwm

-inflate2

?h.white

["mris_inflate"] ?h.white ?h.inflated

?h.inflated

?h.sulc

-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 step

Individual Flag

Input

Command Line

Output

["recon-all"] -autorecon2-wm -subjid subj (use this after doing manual wm edits. This flag will regenerate all necessary volumes and surfaces)

-fill

wm.mgz

["mri_fill"] -a ../scripts/ponscc.cut.log -xform transforms/talairach.lta -segmentation aseg.mgz wm.mgz filled.mgz

filled.mgz

aseg.mgz

../scripts/ponscc.cut.log

transforms/talairach.lta

-tessellate

filled.mgz

["mri_tessellate"] filled.mgz 255 ../surf/lh.orig.nofix

lh.orig.nofix

["mri_tessellate"] filled.mgz 127 ../surf/rh.orig.nofix

rh.orig.nofix

-smooth1

?h.orig.nofix

["mris_smooth"] -nw ?h.orig.nofix ?h.smoothwm.nofix

?h.smoothwm.nofix

-inflate1

?h.smoothwm.nofix

["mris_inflate"] -no-save-sulc ?h.smoothwm.nofix ?h.inflated.nofix

?h.inflated.nofix

-qsphere

?h.inflated.nofix

["mris_sphere"] -q -0 ?h.inflated.nofix ?h.inflated.nofix ?h.qsphere.nofix

?h.qsphere.nofix

-fix

?h.orig.nofix

cp ?h.orig.nofix ?h.orig

?h.orig

?h.inflated.nofix

cp ?h.inflated.nofix ?h.inflated

?h.inflated

?h.qsphere.nofix

["mris_fix_topology"] -errors -mgz -sphere qsphere.nofix -ga <subjid> ?h

?h.orig

-finalsurfs

brain.finalsurfs.mgz

["mris_make_surfaces"] -mgz -w 0 -T1 brain.finalsurfs.mgz subj ?h

?h.white

?h.pial

?h.thickness

?h.orig

?h.curv

?h.area

-smooth2

?h.white

["mris_smooth"] ?h.white ?h.smoothwm

?h.smoothwm

-inflate2

?h.white

["mris_inflate"] ?h.white ?h.inflated

?h.inflated

?h.sulc

-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 step

Individual Flag

Input

Command Line

Output

["recon-all"] -autorecon2-pial -subjid subj (use this after editing brain.mgz to alter pial surface. This flag will regenerate all final surfaces)

-finalsurfs

brain.finalsurfs.mgz

["mris_make_surfaces"] -mgz -w 0 -T1 brain.finalsurfs.mgz subj ?h

?h.white

?h.pial

?h.thickness

?h.orig

?h.curv

?h.area

-smooth2

?h.white

["mris_smooth"] ?h.white ?h.smoothwm

?h.smoothwm

-inflate2

?h.white

["mris_inflate"] ?h.white ?h.inflated

?h.inflated

?h.sulc

-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 step

Individual Flag

Input

Command Line

Output

["recon-all"] -autorecon2-perhemi -subjid subj (use this to run only the steps that are run per-hemisphere, in conjunction with the '-hemi' flag. This is useful if one hemisphere failed and you need to run them separately)

-tessellate

filled.mgz

["mri_tessellate"] filled.mgz 255 ../surf/lh.orig.nofix

lh.orig.nofix

["mri_tessellate"] filled.mgz 127 ../surf/rh.orig.nofix

rh.orig.nofix

-smooth1

?h.orig.nofix

["mris_smooth"] -nw ?h.orig.nofix ?h.smoothwm.nofix

?h.smoothwm.nofix

-inflate1

?h.smoothwm.nofix

["mris_inflate"] -no-save-sulc ?h.smoothwm.nofix ?h.inflated.nofix

?h.inflated.nofix

-qsphere

?h.inflated.nofix

["mris_sphere"] -q -0 ?h.inflated.nofix ?h.inflated.nofix ?h.qsphere.nofix

?h.qsphere.nofix

-fix

?h.orig.nofix

cp ?h.orig.nofix ?h.orig

?h.orig

?h.inflated.nofix

cp ?h.inflated.nofix ?h.inflated

?h.inflated

?h.qsphere.nofix

["mris_fix_topology"] -errors -mgz -sphere qsphere.nofix -ga <subjid> ?h

?h.orig

-finalsurfs

brain.finalsurfs.mgz

["mris_make_surfaces"] -mgz -w 0 -T1 brain.finalsurfs.mgz subj ?h

?h.white

?h.pial

?h.thickness

?h.orig

?h.curv

?h.area

-smooth2

?h.white

["mris_smooth"] ?h.white ?h.smoothwm

?h.smoothwm

-inflate2

?h.white

["mris_inflate"] ?h.white ?h.inflated

?h.inflated

?h.sulc

-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

OtherUsefulFlags (last edited 2017-04-25 13:53:01 by AndrewHoopes)