Differences between revisions 111 and 112
Deletions are marked like this. Additions are marked like this.
Line 141: Line 141:
||<|13(bgcolor='#FFFFE0'>'''[[recon-all]] -autorecon-pial -subjid subj '''(use this after editing brainmask.mgz or brain.finalsurfs.mgz to alter pial surface. This flag will regenerate all final surfaces) **note** this flag includes all the steps in -autorecon3 therefore it is not necessary to pass the -autorecon3 flag after this||
||<|6(bgcolor='#FFFFE0'>-finalsurfs||<|3(bgcolor='#E0E0FF'>brain.finalsurfs.mgz||<|6(bgcolor='#E0E0FF'>[[mris_make_surfaces]] -mgz -w 0 -T1 brain.finalsurfs.mgz subj ?h||<bgcolor='#E0E0FF'>?h.white||
||<rowbgcolor='#E0E0FF'>?h.pial||
||<rowbgcolor='#E0E0FF'>?h.thickness||
||<|3(rowbgcolor='#E0E0FF'>?h.orig||
||<rowbgcolor='#E0E0FF'>?h.curv||
||<rowbgcolor='#E0E0FF'>?h.area||
||<bgcolor='#FFFFE0'>-smooth2||<bgcolor='#E0E0FF'>?h.white||<bgcolor='#E0E0FF'>[[mris_smooth]] ?h.white ?h.smoothwm||<bgcolor='#E0E0FF'>?h.smoothwm||
||<|2(bgcolor='#FFFFE0'>-inflate2||<|2(bgcolor='#E0E0FF'>?h.white||<|2(bgcolor='#E0E0FF'>[[mris_inflate]] ?h.white ?h.inflated||<bgcolor='#E0E0FF'>?h.inflated||
||<(rowbgcolor='#E0E0FF'>?h.sulc||
||<|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||
||<|12(bgcolor='#FFFFE0'>'''[[recon-all]] -autorecon-pial -subjid subj '''(use this after editing brainmask.mgz or brain.finalsurfs.mgz to alter pial surface. This flag will regenerate all final surfaces) <<BR>><<BR>>**note** this flag includes all the steps in -autorecon3 therefore it is not necessary to pass the -autorecon3 flag after this||
||<|2(bgcolor='#FFFFE0'>-maskbfs ||brain.mgz ||<|2(bgcolor='#E0E0FF'>[[mri_mask]] -T 5 brain.mgz brainmask.mgz brain.finalsurfs.mgz ||<|2(bgcolor='#E0E0FF'>brain.finalsurfs.mgz ||
||brainmask.mgz ||
||<|5(bgcolor='#FFFFE0'>-white ||<|1(bgcolor='#E0E0FF'>aseg.mgz, brain.finalsurfs.mgz, wm.mgz, filled.mgz ||<|5(bgcolor='#E0E0FF'>[[mris_make_surfaces]] -whiteonly -noaparc -mgz -T1 brain.finalsurfs <subjid> ?h ||?h.white ||
||<|4(bgcolor='#E0E0FF'>?h.orig ||
||?h.curv ||
||?h.area||
||?h.cortex.label ||
||<bgcolor='#FFFFE0'>-smooth2 ||?h.white ||<bgcolor='#E0E0FF'>[[mris_smooth]] -n 3 -nw ?h.white ?h.smoothwm ||?h.smoothwm ||
||<|4(bgcolor='#FFFFE0'>-inflate2 ||<|2(bgcolor='#E0E0FF'>?h.smoothwm ||<|2(bgcolor='#E0E0FF'>[[mris_inflate]] ?h.smoothwm ?h.inflated ||?h.inflated ||
||<bgcolor='#E0E0FF'>?h.sulc ||
||<|2(bgcolor='#E0E0FF'>?h.inflated ||<|2(bgcolor='#E0E0FF'>[[mris_curvature]] -thresh .999 -n -a 5 -w -distances 10 10 ?h.inflated ||?h.inflated.H ||
||?h.inflated.K ||

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

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

-clean-cw256

-clean-lta

-clean-pfh

trashes preflood height volumes (skullstrip)

-clean-bfse

trashes edits to brain.finalsurfs.manedit.mgz

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

-notal-check

use this flag when running a subject after receiving an error about Tailarach Failure Detection and the tailarach transform looks fine after checking it with this command line: tkregister2 --mgz --s <subjid> --fstal

-gcut

use this flag when skull strip leaves a little bit of dura behind. In this case, adjusting the watershed parameters won't be as useful and manual edits will take too long.
INFO: Care must be taken to thoroughly inspect your data when using -gcut. In particular, inpsect the edges of gm and cerebellum for over-aggressive cutting. Add -segmentation brainmask.gcuts.mgz to tkmedit to view the voxels which gcut has removed.

-surfsegedit

this flag fixes the gm and a few other areas in the aseg using info from the surfaces. Run after the surfaces are done.

-multistrip

use this flag on a subject when you would like to get skullstrip results using several different watershed preflood heights simultaneously. Output will be nu, orig, and T1 volumes stripped at these heights: 5, 10, 20, 30. You can change which preflood heights are used by setting this variable first: setenv WATERSHED_PREFLOOD_HEIGHTS '20 30 40 50'. Be sure to use -clean-bm with this flag.

-deface

removes the face from the orig volume to anonymize it.

-vno_match_check

Confirms that the surface data is out of sync in case an error indicates that there is a size mismatch. Then run from whatever stage that is out of sync.

recon-all flag

Used with step

Description

-no-ca-align

-careg

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.

-calabel

-subcortseg

-gcareg

runs the subcortical segmentation and associated statistics

-canorm

-careg

-rmneck

-skull-lta

-calabel

-segstats

-cc-xyz <X Y Z>

-fill

manually sets the corpus callosum seed point

-pons-xyz <X Y Z>

-fill

manually sets the pons seed point

-rh-xyz <X Y Z>

-fill

manually sets the right hemisphere seed point

-lh-xyz <X Y Z>

-fill

manually sets the left hemisphere seed point

-jacobian_dist0

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

-old-atlas

-gcareg

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.

-canorm

-careg

-calabel

-surfreg

-contrasurfreg

-avgcurv

-cortparc

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-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.auto_noCCseg.mgz wm.mgz filled.mgz

filled.mgz

aseg.auto_noCCseg.mgz

../scripts/ponscc.cut.log

transforms/talairach.lta

-tessellate

filled.mgz

mri_pretess filled.mgz 255 norm.mgz filled-pretess255.mgz

filled-pretess255.mgz

norm.mgz

filled-pretess255.mgz

mri_tessellate filled-pretess255.mgz 255 lh.orig.nofix

lh.orig.nofix

filled.mgz

mri_pretess filled.mgz 127 norm.mgz filled-pretess127.mgz

filled-pretess127.mgz

norm.mgz

filled-pretess127.mgz

mri_tessellate filled-pretess127.mgz 127 rh.orig.nofix

rh.orig.nofix

?h.orig.nofix

mris_extract_main_component ?h.orig.nofix ?h.orig.nofix

?h.orig.nofix

rm -f filled-pretess255.mgz filled-pretess127.mgz

-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 -mgz -sphere qsphere.nofix -ga <subjid> ?h

?h.orig

?h.orig

mris_euler_number ?h.orig

?h.orig

?h.orig

mris_remove_intersection ?h.orig ?h.orig

?h.orig

rm ?h.inflated

-white

aseg.mgz, brain.finalsurfs.mgz, wm.mgz, filled.mgz

mris_make_surfaces -whiteonly -noaparc -mgz -T1 brain.finalsurfs <subjid> ?h

?h.white

?h.orig

?h.curv

?h.area

?h.cortex.label

-smooth2

?h.white

mris_smooth -n 3 -nw ?h.white ?h.smoothwm

?h.smoothwm

-inflate2

?h.smoothwm

mris_inflate ?h.smoothwm ?h.inflated

?h.inflated

?h.sulc

?h.inflated

mris_curvature -thresh .999 -n -a 5 -w -distances 10 10 ?h.inflated

?h.inflated.H

?h.inflated.K

recon-all step

Individual Flag

Input

Command Line

Output

recon-all -autorecon2-noaseg -subjid subj (use this after doing manual edits to the aseg. This flag will regenerate all final surfaces)

-normalization2

brainmask.mgz

mri_normalize -aseg aseg.mgz -mask brainmask.mgz norm.mgz brain.mgz

brain.mgz

norm.mgz

aseg.mgz

-maskbfs

brain.mgz

mri_mask -T 5 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 wm norm.mgz wm.mgz

wm.mgz

norm.mgz

-fill

wm.mgz

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

filled.mgz

aseg.auto_noCCseg.mgz

../scripts/ponscc.cut.log

transforms/talairach.lta

-tessellate

filled.mgz

mri_pretess filled.mgz 255 norm.mgz filled-pretess255.mgz

filled-pretess255.mgz

norm.mgz

filled-pretess255.mgz

mri_tessellate filled-pretess255.mgz 255 lh.orig.nofix

lh.orig.nofix

filled.mgz

mri_pretess filled.mgz 127 norm.mgz filled-pretess127.mgz

filled-pretess127.mgz

norm.mgz

filled-pretess127.mgz

mri_tessellate filled-pretess127.mgz 127 rh.orig.nofix

rh.orig.nofix

?h.orig.nofix

mris_extract_main_component ?h.orig.nofix ?h.orig.nofix

?h.orig.nofix

rm -f filled-pretess255.mgz filled-pretess127.mgz

-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 -mgz -sphere qsphere.nofix -ga <subjid> ?h

?h.orig

?h.orig

mris_euler_number ?h.orig

?h.orig

?h.orig

mris_remove_intersection ?h.orig ?h.orig

?h.orig

rm ?h.inflated

-white

aseg.mgz, brain.finalsurfs.mgz, wm.mgz, filled.mgz

mris_make_surfaces -whiteonly -noaparc -mgz -T1 brain.finalsurfs <subjid> ?h

?h.white

?h.orig

?h.curv

?h.area

?h.cortex.label

-smooth2

?h.white

mris_smooth -n 3 -nw ?h.white ?h.smoothwm

?h.smoothwm

-inflate2

?h.smoothwm

mris_inflate ?h.smoothwm ?h.inflated

?h.inflated

?h.sulc

?h.inflated

mris_curvature -thresh .999 -n -a 5 -w -distances 10 10 ?h.inflated

?h.inflated.H

?h.inflated.K

recon-all step

Individual Flag

Input

Command Line

Output

recon-all -autorecon-pial -subjid subj (use this after editing brainmask.mgz or brain.finalsurfs.mgz to alter pial surface. This flag will regenerate all final surfaces)

**note** this flag includes all the steps in -autorecon3 therefore it is not necessary to pass the -autorecon3 flag after this

-maskbfs

brain.mgz

mri_mask -T 5 brain.mgz brainmask.mgz brain.finalsurfs.mgz

brain.finalsurfs.mgz

brainmask.mgz

-white

aseg.mgz, brain.finalsurfs.mgz, wm.mgz, filled.mgz

mris_make_surfaces -whiteonly -noaparc -mgz -T1 brain.finalsurfs <subjid> ?h

?h.white

?h.orig

?h.curv

?h.area

?h.cortex.label

-smooth2

?h.white

mris_smooth -n 3 -nw ?h.white ?h.smoothwm

?h.smoothwm

-inflate2

?h.smoothwm

mris_inflate ?h.smoothwm ?h.inflated

?h.inflated

?h.sulc

?h.inflated

mris_curvature -thresh .999 -n -a 5 -w -distances 10 10 ?h.inflated

?h.inflated.H

?h.inflated.K

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)