{"id":107,"date":"2020-01-22T19:40:44","date_gmt":"2020-01-22T19:40:44","guid":{"rendered":"https:\/\/ni.cmu.edu\/computing\/?post_type=ht_kb&#038;p=107"},"modified":"2022-01-11T21:31:27","modified_gmt":"2022-01-11T21:31:27","slug":"freesurfer","status":"publish","type":"ht_kb","link":"https:\/\/ni.cmu.edu\/computing\/knowledge-base\/freesurfer\/","title":{"rendered":"FreeSurfer"},"content":{"rendered":"<p><a  href=\"http:\/\/freesurfer.net\">FreeSurfer<\/a> Software Suite is an open source software suite for processing and analyzing MRI images. Documentation can be found on the <a href=\"http:\/\/freesurfer.net\/fswiki\">FreeSurfer Wiki<\/a>.<\/p>\n<h4><a name=\"Example_Interactive_session\"><\/a> Example Interactive session:<\/h4>\n<pre>[dpane@mind ~]$ srun -p cpu --cpus-per-task=1 --mem=10GB --time=4:00:00 --pty bash\r\n[dpane@mind-0-12 ~]$ module avail\r\n\r\n----------------------------------- \/usr\/share\/Modules\/modulefiles ------------------------------------\r\nanaconda3              cudnn-9.2-7.6          git-2.30               null\r\ncuda-10.0              dot                    glx-indirect           openmpi-1.10-x86_64\r\ncuda-10.1              dsi-studio             julia-1.2.0            openmpi-1.8-x86_64\r\ncuda-10.2              freesurfer-5.3.0       matlab-9.11            openmpi-x86_64\r\ncuda-11.1.1            freesurfer-6.0.0       matlab-9.5             qt-4.8.2\r\ncuda-9.2               freesurfer-7.1.0       matlab-9.7             qt-4.8.5\r\ncudnn-10.0-7.3         fsl-6.0.3              module-git             R-3.6.1\r\ncudnn-10.1-v7.6.5.32   gcc-4.7.4              module-info            rstudio-1.2.5033\r\ncudnn-10.2-v7.6.5.32   gcc-4.9.2              modules                singularity\r\ncudnn-11.1.1-v8.0.4.30 gcc-6.3.0              mrtrix3-3.0.0-git      use.own\r\n[dpane@mind-0-12 ~]$ \r\n[dpane@mind-0-12 ~]$ module load freesurfer-7.1.0 \r\n[dpane@mind-0-12 ~]$ which freesurfer\r\n\/opt\/freesurfer\/7.1.0\/bin\/freesurfer\r\n[dpane@mind-0-12 ~]$ which recon-all\r\n\/opt\/freesurfer\/7.1.0\/bin\/recon-all\r\n[dpane@mind-0-12 ~]$ \r\n<\/pre>\n<p><b><i>EXAMPLE COMMAND: Replace: &lt;input file.dcm&gt; with the path to the data file; &lt;subject id&gt; with the Id for the subject; and &lt;Output directory&gt; with the full path to a directory to save the output.<\/i><\/b><\/p>\n<pre>[dpane@mind-0-12 ~]$  recon-all -i &lt;input file .dcm&gt; -s &lt;subject id&gt; -autorecon-all -sd &lt;Output directory&gt;\r\n[dpane@mind-0-12 ~]$ \r\n[dpane@mind-0-12 ~]$ exit\r\nexit\r\n[dpane@mind ~]$ \r\n<\/pre>\n<p><b><i>For detailed help, after loading the freesurfer module you can type the following command.<\/i><\/b><\/p>\n<pre>[dpane@mind-0-12 ~]$ recon-all --help\r\n\r\nUSAGE: recon-all\r\n\r\n Required Arguments:\r\n   -subjid <subjid>\r\n   -<process directive>\r\n\r\n Fully-Automated Directive:\r\n  -all           : performs all stages of cortical reconstruction\r\n  -autorecon-all : same as -all\r\n\r\n Manual-Intervention Workflow Directives:\r\n  -autorecon1    : process stages 1-5 (see below)\r\n  -autorecon2    : process stages 6-23\r\n                   after autorecon2, check white surfaces:\r\n                     a. if wm edit was required, then run -autorecon2-wm\r\n                     b. if control points added, then run -autorecon2-cp\r\n                     c. proceed to run -autorecon3\r\n  -autorecon2-cp : process stages 12-23 (uses -f w\/ mri_normalize, -keep w\/ mri_seg)\r\n  -autorecon2-wm : process stages 15-23\r\n  -autorecon2-inflate1 : 6-18\r\n  -autorecon2-perhemi : tess, sm1, inf1, q, fix, sm2, inf2, finalsurf, ribbon\r\n  -autorecon3    : process stages 24-34\r\n                     if edits made to correct pial, then run -autorecon-pial\r\n  -hemi ?h       : just do lh or rh (default is to do both)\r\n\r\n  Autorecon Processing Stages (see -autorecon# flags above):\r\n    1.  Motion Correction and Conform\r\n    2.  NU (Non-Uniform intensity normalization)\r\n    3.  Talairach transform computation\r\n    4.  Intensity Normalization 1\r\n    5.  Skull Strip\r\n\r\n    6.  EM Register (linear volumetric registration)\r\n    7.  CA Intensity Normalization\r\n    8.  CA Non-linear Volumetric Registration \r\n    9.  Remove neck\r\n    10. EM Register, with skull\r\n    11. CA Label (Aseg: Volumetric Labeling) and Statistics\r\n\r\n    12. Intensity Normalization 2 (start here for control points)\r\n    13. White matter segmentation\r\n    14. Edit WM With ASeg\r\n    15. Fill (start here for wm edits)\r\n    16. Tessellation (begins per-hemisphere operations)\r\n    17. Smooth1\r\n    18. Inflate1\r\n    19. QSphere\r\n    20. Automatic Topology Fixer\r\n    21. White Surfs (start here for brain edits for pial surf)\r\n    22. Smooth2\r\n    23. Inflate2\r\n\r\n    24. Spherical Mapping\r\n    25. Spherical Registration \r\n    26. Spherical Registration, Contralater hemisphere\r\n    27. Map average curvature to subject\r\n    28. Cortical Parcellation (Labeling)\r\n    29. Cortical Parcellation Statistics\r\n    30. Pial Surfs\r\n    31. WM\/GM Contrast\r\n    32. Cortical Ribbon Mask\r\n    33. Cortical Parcellation mapped to ASeg\r\n    34  Brodmann and exvio EC labels\r\n\r\n Step-wise Directives\r\n  See -help\r\n\r\n Expert Preferences\r\n  -pons-crs C R S : col, row, slice of seed point for pons, used in fill\r\n  -cc-crs C R S : col, row, slice of seed point for corpus callosum, used in fill\r\n  -lh-crs C R S : col, row, slice of seed point for left hemisphere, used in fill\r\n  -rh-crs C R S : col, row, slice of seed point for right hemisphere, used in fill\r\n  -nofill        : do not use the automatic subcort seg to fill\r\n  -watershed cmd : control skull stripping\/watershed program\r\n  -wsless : decrease watershed threshold (leaves less skull, but can strip more brain)\r\n  -wsmore : increase watershed threshold (leaves more skull, but can strip less brain)\r\n  -wsatlas : use atlas when skull stripping\r\n  -no-wsatlas : do not use atlas when skull stripping\r\n  -no-wsgcaatlas : do not use GCA atlas when skull stripping\r\n  -wsthresh pct : explicity set watershed threshold\r\n  -wsseed C R S : identify an index (C, R, S) point in the skull\r\n  -norm3diters niters : number of 3d iterations for mri_normalize\r\n  -normmaxgrad maxgrad : max grad (-g) for mri_normalize. Default is 1.\r\n  -norm1-b N : in the _first_ usage of mri_normalize, use control \r\n               point with intensity N below target (default=10.0) \r\n  -norm2-b N : in the _second_ usage of mri_normalize, use control \r\n               point with intensity N below target (default=10.0) \r\n  -norm1-n N : in the _first_ usage of mri_normalize, do N number \r\n               of iterations\r\n  -norm2-n N : in the _second_ usage of mri_normalize, do N number \r\n               of iterations\r\n  -cm           : conform volumes to the min voxel size \r\n  -no-fix-with-ga : do not use genetic algorithm when fixing topology\r\n  -fix-diag-only  : topology fixer runs until ?h.defect_labels files\r\n                    are created, then stops\r\n  -seg-wlo wlo : set wlo value for mri_segment and mris_make_surfaces\r\n  -seg-ghi ghi : set ghi value for mri_segment and mris_make_surfaces\r\n  -nothicken   : pass '-thicken 0' to mri_segment\r\n  -no-ca-align-after : turn off -align-after with mri_ca_register\r\n  -no-ca-align : turn off -align with mri_ca_label\r\n  -deface      : deface subject, written to orig_defaced.mgz\r\n\r\n  -expert file     : read-in expert options file\r\n  -xopts-use       : use pre-existing expert options file\r\n  -xopts-clean     : delete pre-existing expert options file\r\n  -xopts-overwrite : overwrite pre-existing expert options file\r\n  -termscript script : run script before exiting (multiple -termscript flags possible)\r\n   This can be good for running custom post-processing after recon-all\r\n   The script must be in your path. The subjid is passed as the only argument\r\n   The current directory is changed to SUBJECTS_DIR before the script is run\r\n   The script should exit with 0 unless there is an error\r\n\r\n  -mprage : assume scan parameters are MGH MP-RAGE protocol\r\n  -washu_mprage : assume scan parameters are Wash.U. MP-RAGE protocol.\r\n                  both mprage flags affect mri_normalize and mri_segment,\r\n                  and assumes a darker gm.\r\n  -schwartzya3t-atlas : for tal reg, use special young adult 3T atlas\r\n\r\n  -threads num  : set number of threads to use\r\n\r\n Notification Files (Optional)\r\n  -waitfor file : wait for file to appear before beginning\r\n  -notify  file : create this file after finishing\r\n\r\n Status and Log files (Optional)\r\n  -log     file : default is scripts\/recon-all.log\r\n  -status  file : default is scripts\/recon-all-status.log\r\n  -noappend     : start new log and status files instead of appending\r\n  -no-isrunning : do not check whether this subject is currently being processed\r\n\r\n Segmentation of substructures of hippocampus and brainstem \r\n (These deprecated; please see segmentHA_T1.sh, segmentHA_T1.sh, segmentHA_T1_long.sh, segmentBS.sh)\r\n  -hippocampal-subfields-T1 : segmentation of hippocampal subfields using input T1 scan\r\n  -hippocampal-subfields-T2 file ID : segmentation using an additional scan (given by file);\r\n                                      ID is a user-defined identifier for the analysis\r\n  -hippocampal-subfields-T1T2 file ID : segmentation using additional scan (given by file) and input T1\r\n                                        simultaneously; ID is a user-defined identifier for the analysis\r\n  -brainstem-structures : segmentation of brainstem structures\r\n\r\n Other Arguments (Optional)\r\n  -sd subjectsdir : specify subjects dir (default env SUBJECTS_DIR)\r\n  -mail username  : mail user when done\r\n  -umask umask    : set unix file permission mask (default 002)\r\n  -grp groupid    : check that current group is alpha groupid \r\n  -onlyversions   : print version of each binary and exit\r\n  -debug          : print out lots of info\r\n  -allowcoredump  : set coredump limit to unlimited\r\n  -dontrun        : do everything but execute each command\r\n  -version        : print version of this script and exit\r\n  -help           : voluminous bits of wisdom\r\n\r\n7.1.0 (freesurfer-linux-centos7_x86_64-7.1.0-20200511-813297b)\r\n\r\n\r\nPerforms all, or any part of, the FreeSurfer cortical reconstruction\r\nprocess. This help only gives some simple information. For more\r\ndetailed documentation, see https:\/\/surfer.nmr.mgh.harvard.edu\r\n\r\nBasic usages:\r\n\r\n1. Subject dir does not exist:\r\n\r\n  recon-all -subject subjectname -i invol1 <-i invol2> -all\r\n\r\nCreates analysis directory $SUBJECTS_DIR\/subjectname, converts one or\r\nmore input volumes to MGZ format in subjectname\/mri\/orig, and runs\r\nall processing steps. If subjectname exists, then an error is returned\r\nwhen -i is used; but this can be overridden with -force (in which\r\ncase any pre-existing source volumes are deleted).\r\n\r\n2. Manual conversion into mgz:\r\n\r\n  mkdir -p $SUBJECTS_DIR\/subjectname\/mri\/orig\r\n  mri_convert invol1 $SUBJECTS_DIR\/subjectname\/mri\/orig\/001.mgz\r\n  mri_convert invol2 $SUBJECTS_DIR\/subjectname\/mri\/orig\/002.mgz\r\n  recon-all -subject subjectname -all\r\n\r\nIf no input volumes are given, then it is assumed that the subject\r\ndirectory has already been created and that the raw data already\r\nexists in MGZ format in subjid\/mri\/orig as XXX.mgz, where XXX is a\r\n3-digit, zero-padded number.\r\n\r\n\r\nSUBJECT IDENTIFICATION STRING\r\n\r\n-s subjectname\r\n-sid subjectname\r\n-subjid subjectname\r\n-subject subjectname\r\n\r\n'subjectname' is the FreeSurfer subject identification string which doubles\r\nas the name of the reconstruction root directory for this subject. This\r\nreconstruction should be referenced by this string for all FreeSurfer\r\ncommands and in the register.dat matrix (for functional interfacing).\r\n\r\n\r\nSPECIFYING DIRECTIVES\r\n\r\nDirectives instruct recon-all which part(s) of the reconstruction\r\nstream to run. While it is possible to do everything in one shot (using\r\nthe -all flag), there can be some benefits to customizing the\r\nstream. These benefits include stopping to perform manual editing as\r\nwell as parallelization. Directives are either clustered or step-wise.\r\nClustered directives are sets of steps that can be performed by\r\nspecifying a single flag. A step-wise directive refers to a single\r\nstep.  Directives accumulate. A step can be removed from a cluster by\r\nadding -no<step> after the cluster flag. For example, specifying\r\n-all followed by -notalairach will perform all the reconstruction\r\nsteps except talairaching. However, note that if -notalairach *preceeded*\r\n-all, talairaching would still be performed.\r\n\r\n\r\nCLUSTERED DIRECTIVES\r\n\r\n-all\r\n-autorecon-all\r\n\r\nPerform all reconstruction steps.\r\n\r\n-autorecon1\r\n\r\nMotion correction through skull strip.\r\n\r\n-autorecon2\r\n\r\nSubcortical segmentation through make white surfaces.\r\n\r\n-autorecon2-cp\r\n\r\nNormalization2 through make final surfaces.\r\n\r\n-autorecon2-wm\r\n\r\nFill through make white surfaces. Used after editing wm volume after running\r\n-autorecon2.\r\n\r\n-autorecon-pial\r\n\r\nMakes final surfaces (white and pial). Used after editing brain.finalsurfs\r\nvolume after running -autorecon2. The brain.finalsurfs.mgz volume may be\r\nedited to fix problems with the pial surface.\r\n\r\n-autorecon3\r\n\r\nSpherical morph, automatic cortical parcellation, pial surf and ribbon mask.\r\n\r\n\r\nSTEP-WISE DIRECTIVES\r\n\r\nStep-wise directives allow the user to implement a single step in the\r\nreconstruction process. See also STEP DESCRIPTION SUMMARIES below.\r\nThey also allow users to include\/exclude a step from a clustered\r\nDIRECTIVE. To include a step, use -step (eg, -skullstrip). To exclude\r\na step, use -nostep (eg -noskullstrip).\r\n\r\nRun times are approximate for an Intel Xeon E5-2643 64bit 3.4GHz processor:\r\n\r\n  -<no>motioncor          2 min\r\n  -<no>talairach        < 1 min\r\n  -<no>normalization      2 min\r\n  -<no>skullstrip        15 min\r\n  -<no>nuintensitycor     1 min\r\n  -<no>gcareg            15 min\r\n  -<no>canorm             1 min\r\n  -<no>careg              1 hour\r\n  -<no>rmneck             1 min\r\n  -<no>skull-lta         12 min\r\n  -<no>calabel           34 min\r\n  -<no>normalization2     3 min\r\n  -<no>maskbfs          < 1 min\r\n  -<no>segmentation       1 min\r\n  -<no>fill               1 min\r\n  -<no>tessellate       < 1 min     per hemisphere\r\n  -<no>smooth1          < 1 min     per hemisphere\r\n  -<no>inflate1           1 min     per hemisphere\r\n  -<no>qsphere            3 min     per hemisphere\r\n  -<no>fix               15 min     per hemisphere\r\n  -<no>white              3 min     per hemisphere\r\n  -<no>smooth2          < 1 min     per hemisphere\r\n  -<no>inflate2         < 1 min     per hemisphere\r\n  -<no>curvHK           < 1 min     per hemisphere\r\n  -<no>curvstats        < 1 min     per hemisphere\r\n  -<no>sphere            40 min     per hemisphere\r\n  -<no>surfreg           50 min     per hemisphere\r\n  -<no>jacobian_white   < 1 min     per hemisphere\r\n  -<no>avgcurv          < 1 min     per hemisphere\r\n  -<no>cortparc           1 min     per hemisphere\r\n  -<no>pial               4 min     per hemisphere\r\n  -<no>surfvolune       < 1 min     per hemisphere\r\n  -<no>cortribbon        15 min\r\n  -<no>parcstats        < 1 min     per hemisphere\r\n  -<no>cortparc2          1 min     per hemisphere\r\n  -<no>parcstats2       < 1 min     per hemisphere\r\n  -<no>cortparc3          1 min     per hemisphere\r\n  -<no>parcstats3       < 1 min     per hemisphere\r\n  -<no>pctsurfcon       < 1 min     per hemisphere\r\n  -<no>hyporelabel      < 1 min     per hemisphere\r\n  -<no>aparc2aseg         1 min\r\n  -<no>apas2aseg          1 min\r\n  -<no>segstats           3 min\r\n  -<no>wmparc             7 min\r\n  -<no>balabels           5 min     per hemisphere\r\n\r\n  -all                    7 hours   both hemipheres\r\n\r\nIf -parallel is specified, runtime is reduced to 3 hours.\r\n\r\n\r\nSEGMENTATION OF HIPPOCAMPAL SUBFIELDS  AND NUCLEI OF THE AMYGDALA (CROSS-SECTIONAL AND LONGITUDINAL)\r\n\r\nThe following flags can be used to obtain a segmentation of the hippocampal subfields,\r\nas well as of the nuclei of the amygdala.\r\nThe methods are described in [17] (hippocampus) and [19] (amygdala). There is also a\r\nlongitudinal version of the algorithm [20]. You can find further information here:\r\nhttps:\/\/surfer.nmr.mgh.harvard.edu\/fswiki\/HippocampalSubfieldsAndNucleiOfAmygdala\r\n\r\nNote that the following 6.0 flags have been deprecated:\r\n\r\n-hippocampal-subfields-T1\r\n-hippocampal-subfields-T2 \r\n-hippocampal-subfields-T1T2 \r\n\r\nAnd replaced by the following scripts (for help, run them with flag --help): \r\n\r\nsegmentHA_T1.sh: Uses the T1 scan which the recon-all stream has processed at 1 mm \r\nresolution or higher (with -cm).\r\n\r\nsegmentHA_T2.sh: It uses an additional scan in the segmentation, typically  (but\r\nnot necessarily) a T2 volume with higher resolution, at least in the coronal plane. \r\nThis additional scan can be used in isolation or in combination with the T1 volume\r\nprocessed with recon-all\r\n\r\nsegmentHAsegment_T1_long.sh: This is the longitudinal version of segmentHA_T1.sh.\r\n\r\n\r\nSEGMENTATION OF BRAINSTEM STRUCTURES\r\n\r\nThis module performs segmentation of brains structures (medulla, pons, midbrain, SCP) on \r\nthe T1 scan which the  recon-all stream has processed, at 1 mm or higher resolution (with \r\n-cm). The method is described in [18]. You can read more at: \r\nhttp:\/\/surfer.nmr.mgh.harvard.edu\/fswiki\/BrainstemSubstructures\r\n\r\nNote that the following 6.0 flag has been deprecated:\r\n\r\n-brainstem-structures\r\n\r\nAnd replaced by the following script (for help, run it with flag --help): \r\n\r\nsegmentBS.sh\r\n\r\n\r\nEXPERT PREFERENCES\r\n\r\n-pons-crs C R S\r\n\r\nSpecify a seed point for the pons during the fill operation. This is\r\nused to cut the brain stem from brain. By default, this point will be\r\ndetermined automatically. It should only be specified if there is a\r\ncut failure. To determine what this point should be, find the center\r\nof the pons in the T1 volume (in tkmedit) and record the column, row,\r\nand slice. Creates a file called scripts\/seed-ponscrs.man.dat\r\nwith the CRS.\r\n\r\n-cc-crs C R S\r\n\r\nSpecify a seed point for the corpus callosum during the fill\r\noperation. This is used to help separate the hemispheres.  By default,\r\nthis point will be determined automatically. It should only be\r\nspecified if there is a cut failure.  To determine what this point\r\nshould be, find the center of the CC in the T1 volume (in tkmedit) and\r\nrecord the column, row, and slice. Creates a file called\r\nscripts\/seed-cccrs.man.dat with the CRS.\r\n\r\n-lh-crs C R S\r\n\r\nSpecify a seed point for the left hemisphere during the fill\r\noperation. This is used to help identify the left hemisphere.  By\r\ndefault, this point will be determined automatically. It should only\r\nbe specified if there is a cut failure.  To determine what this point\r\nshould be, find a point in the white matter mass of the left\r\nhemisphere in the T1 volume (in tkmedit) and record the column, row,\r\nand slice. Creates a file called scripts\/seed-cccrs.man.dat with the\r\nCRS. Remember that tkmedit displays the volume in radiological\r\nconvention (ie, left is right).\r\n\r\n-rh-crs C R S\r\n\r\nSame as -lh-crs but for the right hemisphere. Creates a file called\r\nscripts\/seed-rhcrs.man.dat with the CRS.\r\n\r\n-watershed cmd\r\n\r\nThis controls how the skull stripping will be performed. Legal values are\r\nnormal (the default), atlas, nowatershed, watershedonly, and watershedtemplate.\r\n\r\n-wsmore\/-wsless\r\n\r\nIncrease\/decrease the preflooding height (threshold) when skull\r\nstripping. -wsmore will expand the skull surface; -wsless will shrink\r\nthe skull surface.  See also -wsthresh.\r\n\r\n-wsthresh pctheight\r\n\r\nExplicitly set the preflooding height when skull stripping.\r\n\r\n-wsseed R C S\r\n\r\nSupply a point in the volume that the user believes to be in the white\r\nmatter.  By default, this point will be determined automatically. It\r\nshould only be specified if there is a strip failure. To determine\r\nwhat this point should be, find a point in the white matter using\r\ntkmedit and record the Volume Index values (NOT the XYZ coordinates).\r\n\r\n-no-wsgcaatlas\r\n\r\nDisable usage of the GCA atlas when running mri_watershed skull-stripping.\r\nThe default is to use the GCA atlas to locate anatomy aiding skull-strip.\r\n\r\n-gca gcafile\r\n\r\nSpecify the name of the gaussian classifier array (GCA) file\r\nto be used with GCA registration and automatic subcortical\r\nsegmentation. It must be found in the FREESURFER_HOME\/average directory (or\r\nuse -gca-dir to specify an alternate path).\r\nThe Default is RB_all_YYYY-MM-DD.gca located in\r\nFREESURFER_HOME\/average. This has no effect unless the GCA registration\r\nor subcortical segmentation stages are to be performed.\r\n\r\n-gca-skull gcafile\r\n\r\nSpecify the name of the gaussian classifier array (GCA) file to be used with\r\nregistration with skull.  It must be found in the FREESURFER_HOME\/average\r\ndirectory (or use -gca-dir to specify an alternate path).\r\nThe default is RB_all_withskull_YYYY-MM-DD.gca located in\r\nFREESURFER_HOME\/average.\r\n\r\n-gcs gcsfile\r\n\r\nSpecify the name of the gaussian classifier surface atlas (GCS) file\r\nto be used for the cortical parcellation stage. It must be found in the\r\nFREESURFER_HOME\/average directory (or use -gcs-dir to specify an alternate\r\npath). The default is named\r\ncurvature.buckner40.filled.desikan_killiany.2007-06-20.gcs and is located in\r\nFREESURFER_HOME\/average.\r\n\r\n-twm twmfile\r\n\r\nWhere (twmfile) is a control.dat format file (a point set in freeview)\r\nwith points manually selected to be in the white matter inferior to\r\nhippocampus in the temporal lobe. This option is passed to mri_ca_register.\r\n\r\n-nuiterations\r\n\r\nNumber of iterations in the non-uniform intensity correction.\r\nDefault is 2.\r\n\r\n-norm3diters niters\r\n\r\nUse niters 3d normalization iterations (passes as -n to _both_ runs of\r\nmri_normalize).\r\n\r\n-normmaxgrad maxgrad\r\n\r\nPasses \"-g maxgrad\" to _both_ runs of mri_normalize. Max grad default is 1.\r\n\r\n-norm1-b N\r\n\r\nIn the _first_ usage of mri_normalize (during creation of T1.mgz), use\r\ncontrol point with intensity N below target (default=10.0)\r\n\r\n-norm1-n N\r\n\r\nIn the _first_ usage of mri_normalize, do N number of iterations\r\n\r\n-norm2-b N\r\n\r\nIn the _second_ usage of mri_normalize (during creation of brain.mgz), use\r\ncontrol point with intensity N below target (default=10.0)\r\n\r\n-norm2-n N\r\n\r\nIn the _second_ usage of mri_normalize, do N number of iterations\r\n\r\n-noaseg\r\n\r\nSkips subcortical segmentation steps (same as -nosubcortseg), and does\r\nnot use aseg.presurf.mgz for inorm2, wm segmentation, or filling. \r\nUse this flag for brains that do not support usage of Freesurfers subcortical\r\nsegmentation, such as baby brains, or non-human primates.\r\n\r\n-noaseg-inorm2\r\n\r\nDoes not use aseg.presurf.mgz for the second mri_normalize step.\r\n\r\n-bigventricles\r\n\r\nIf a subject has enlarged ventricles due to atrophy, include the -bigventricles\r\nflag with the -autorecon2 stage in order to prevent surfaces extending into\r\nthe ventricle regions. The flag directly affects the binary mri_ca_register,\r\nand mris_make_surfaces indirectly via aseg.presurf.mgz.\r\n\r\n-norandomness\r\n\r\nThe random number generator used by certain binaries is seeded with the\r\nsame number, thus producing identical results from run to run.\r\n\r\n-cw256\r\n\r\nInclude this flag after -autorecon1 if images have a FOV > 256.  The\r\nflag causes mri_convert to conform the image to dimensions of 256^3.\r\n\r\n-notal-check\r\n\r\nSkip the automatic failure detection of Talairach alignment.\r\n\r\n-qcache\r\n\r\nProduce the pre-cached files required by the Qdec utility, allowing rapid\r\nanalysis of group data.  These files are created by running mris_preproc,\r\nwhich creates smoothed surface data files sampled to the 'fsaverage'\r\ncommon-space surface. By default, the surface data for thickness, curv, sulc,\r\narea and jacobian_white are smoothed at 0, 5, 10, 15, 20, and 25 mm FWHM.\r\nIf just one set of surface data needs to be processed, then the option\r\n-measure <surfmeas> can follow -qcache, where <surfmeas> is one of: thickness,\r\ncurv, sulc, area, jacobian_white or any surface measure. Multiple instances\r\nof -measure <meas> is supported.  The -measuredir option allows\r\nspecifying a directory other than the default of surf. Another option is\r\n-fwhm <num> where <num> is a value in mm.  Also, -target <name> allows\r\nspecifying a common-space target other than fsaverage (the default).\r\nqcache is also a target for make, eg. recon-all -make qcache\r\nSee also: http:\/\/surfer.nmr.mgh.harvard.edu\/fswiki\/Qdec\r\n\r\n-smooth-cortex-only\r\n\r\nOnly applies with -qcache. Only smooth data if it is part of the ?h.cortex.label.\r\nThis prevents values in the medial wall (which are meaningless) from being\r\nsmoothed into cortical areas. This is the default and you will have to turn\r\nit off with -no-smooth-cortex-only.\r\n\r\n-no-smooth-cortex-only\r\n\r\nAllow medial wall values to smooth into cortex.\r\n\r\n-make target\r\n\r\nRuns recon-all through 'make', the standard utility used to create a file\r\nonly if its dependencies are out-of-date.  This -make option makes use of the\r\nfile recon-all.makefile, where the dependency chain is specified.\r\nA 'target' argument must be specified.  The valid targets are:\r\n\r\n  all\r\n  autorecon1\r\n  autorecon2\r\n  autorecon2-volonly\r\n  autorecon2-perhemi\r\n  autorecon3\r\n  qcache\r\n\r\nThese targets correspond to their flag equivalents in recon-all.  The\r\ndifference in behaviour is that files are created only if the file does not\r\nexist or if an input file used to create it has a newer date than the file\r\nin need of creation.  It is also possible to supply the full pathname to a\r\nparticular file as a target.\r\n\r\nThe flag -dontrun can also be specified to show the commands that will run\r\nwithout excuting them.\r\n\r\n-lgi\r\n-lGI\r\n-localGI\r\n\r\nComputes local measurements of pial-surface gyrification at thousands of\r\npoints over the cortical surface. See reference [13] for details.\r\n\r\n-label_v1\r\n\r\nCreate a label of V1, based on Hinds et al., NeuroImage 39 (2008) 1585-1599.\r\n\r\n-balabels\r\n-ba-labels\r\n-ba_labels\r\n\r\nCreates Brodmann area labels of BA1, BA2, BA3a, BA3b, BA4a, BA4p, BA6, BA44,\r\nBA45, V1, V2, and V5\/MT (and perirhinal) by mapping labels from the \r\n'fsaverage' subject, which must exist within the SUBJECTS_DIR.  \r\nBased on:\r\n\"Cortical Folding Patterns and Predicting Cytoarchitecture\", Fischl et al.,\r\nCerebral Cortex 2007.\r\n\r\n-threads num\r\n-openmp num\r\n\r\nSet the number of threads available to openMP-enabled tools.\r\n\r\n\r\nEXPERT OPTIONS FILE\r\n\r\nWhile the expert preferences flags supported by recon-all cover most\r\nof the instances where special flags need to be passed to a FreeSurfer\r\nbinary, to allow passing an arbitrary flag to a binary, recon-all\r\nsupports the reading of a user-created \"expert options\" (xopts) file\r\ncontaining options to append to the command string. This may be used\r\nto specify new options or to override default values. There are two\r\ntypes xopts file, local and global. The local file you pass on the\r\ncommand line and is used only for the subject you run it with. The\r\nglobal is place in $SUBJECTS_DIR\/global-expert-options.txt and will be\r\nused with every call to recon-all for subjects in $SUBJECTS_DIR. If\r\nboth contain options for the same command, then the local xopts file\r\ntakes precedence.\r\n\r\nEach line of the xopts file corresponds to one command. The first item\r\nis the name of the command; the items following it on rest of the line\r\nwill be passed as the extra options.  For example, if a file called\r\nexpert.opts is created containing these lines:\r\n\r\n  mri_em_register -p .5\r\n  mris_topo_fixer -asc\r\n\r\nthen the option \"-p .5\" will be passed to mri_em_register, and \"-asc\"\r\nwill be passed to mris_topo_fixer.  The name of the expert options file\r\nis passed to recon-all with the -expert flag, eg.\r\n\r\n  recon-all -expert expert.opts ...\r\n\r\nWhen an expert options is passed, it will be copied to scripts\/expert-options.\r\nFuture calls to recon-all, the user MUST explicitly specify how to treat this file.\r\nOptions are (1) use the file (-xopts-use), or (2) delete it (-xopts-clean). If\r\nthis file exsts and the user specifies another expert options file, then\r\nthe user must also specify -xopts-overwrite.\r\n\r\nThe following FreeSurfer binaries will accept an expert option:\r\n\r\n  talairach_avi\r\n  mri_normalize\r\n  mri_watershed\r\n  mri_em_register\r\n  mri_ca_normalize\r\n  mri_ca_register\r\n  mri_remove_neck\r\n  mri_ca_label\r\n  mri_segstats\r\n  mri_mask\r\n  mri_segment\r\n  mri_edit_wm_with_aseg\r\n  mri_pretess\r\n  mri_fill\r\n  mri_tessellate\r\n  mris_smooth\r\n  mris_inflate\r\n  mris_sphere\r\n  mris_fix_topology\r\n  mris_topo_fixer\r\n  mris_remove_intersection\r\n  mris_make_surfaces\r\n  mris_surf2vol\r\n  mris_register\r\n  mris_jacobian\r\n  mrisp_paint\r\n  mris_ca_label\r\n  mris_anatomical_stats\r\n  mri_aparc2aseg\r\n\r\n\r\nNOTIFICATION FILES\r\n\r\nNotification files allow the user to cascade invocations to recon-all,\r\nwith one invocation waiting until another one terminates. This is done\r\nby specifying a file that must exist before an invocation can precede\r\n(-waitfor) and\/or specifying a file that is created when an invocation\r\nterminates (-notify). This type of interprocess communication can\r\nallow users to parallelize the stream. If this is to be done, note\r\nthat each hemisphere can be run separately by specifying the -hemi\r\nflag.\r\n\r\n\r\nLOG AND STATUS FILES\r\n\r\nBy default, log and status files are created in subjid\/scripts. The\r\nlog file contains all the output from all the programs that have been\r\nrun during the invocation to recon-all. The status file has a list of\r\nall the programs that have been run and the time at which each\r\nstarted. The log file is intended to be a record of what was done\r\nwhereas the status file allows the user to easily see where in the\r\nstream a currently running process is. The log file should be sent\r\nwith all bug reports. By default, these files are called recon-all.log\r\nand recon-all-status.log, but this can be changed with the -log and\r\n-status options. By default, the log and status are appended to. New\r\nlog and status files can be forced with the -noappend flag.\r\n\r\n\r\nOTHER ARGUMENTS\r\n\r\n-sd subjectsdir\r\n\r\nThis allows the user to specify the root of the FreeSufer subjects\r\ndirectory. If unspecified, the environment variable SUBJECTS_DIR\r\nis used.\r\n\r\n-mail username\r\n\r\nSend email to username when the process terminates.\r\n\r\n\r\nSTEP DESCRIPTION SUMMARIES\r\n\r\nMotion Correction (-<no>motioncor)\r\n\r\nWhen there are multiple source volumes, this step will correct for\r\nsmall motions between them and then average them together. The input\r\nare the volumes found in file(s) mri\/orig\/XXX.mgz. The output will be\r\nthe volume mri\/orig.mgz. If no runs are found, then it looks for\r\na volume in mri\/orig (or mri\/orig.mgz). If that volume is there, then\r\nit is used in subsequent processes as if it was the motion corrected\r\nvolume. If no volume is found, then the process exits with errors.\r\nThe motion correction step uses a robust registration [14] procedure\r\nto produce highly accurate registrations of the brain, ignoring outlier\r\nregions, such as differen cropping planes, jaw, neck, eye movement etc.\r\n\r\nTalairach (-<no>talairach)\r\n\r\nThis computes the affine transform from the orig volume to the MNI305\r\natlas using Avi Snyders 4dfp suite of image registration tools,\r\nthrough a FreeSurfer script called talairach_avi. Several of the downstream\r\nprograms use talairach coordinates as seed points. You can\/should check\r\nhow good the talairach registration is using\r\n\"tkregister2 --s subjid --fstal-avi\". You must have an \"fsaverage\" subject in\r\nyour SUBJECTS_DIR. tkregister2 allows you to compare the orig volume\r\nagainst the talairach volume resampled into the orig space. If you modify\r\nthe registration, it will change the talairach.xfm file. Your edits will\r\nbe *not* be overwritten unless you run recon-all specifying -clean-tal.\r\nRun \"tkregister2 --help\" for more information.\r\nCreates the files mri\/transform\/talairach.auto.xfm and talairach.xfm.\r\nThe flag -tal-check will check the registration against known-good transforms.\r\nAdding the flag -use-mritotal after -talairach will use the MINC program\r\nmritotal (see Collins, et al., 1994) to perform the transform.\r\n\r\nNormalization (-<no>normalization)\r\n\r\nPerforms intensity normalization of the orig volume and places the\r\nresult in mri\/T1.mgz. Attempts to correct for fluctuations in\r\nintensity that would otherwise make intensity-based segmentation much\r\nmore difficult. Intensities for all voxels are scaled so that the mean\r\nintensity of the white matter is 110. If there are problems with the\r\nnormalization, users can add control points. See also Normalization2.\r\n\r\nSkull Strip (-<no>skullstrip)\r\n\r\nRemoves the skull from mri\/T1.mgz and stores the result in\r\nmri\/brainmask.auto.mgz and mri\/brainmask.mgz.\r\nRuns the mri_watershed program. If the strip fails, users can specify\r\nseed points (-wsseed) or change the threshold (-wsthresh, -wsmore, -wsless).\r\nThe -autorecon1 stage ends here.\r\n\r\nNU Intensity Correction (-<no>nuintensitycor)\r\n\r\nNon-parametric Non-uniform intensity Normalization (N3), corrects for\r\nintensity non-uniformity in MR data,  making relatively few assumptions\r\nabout the data.  This runs the MINC tool 'nu_correct'.  By default, one\r\niteration of nu_correct is run.  The flag -nuiterations specification\r\nof some other number of iterations.\r\n\r\nAutomatic Subcortical Segmentation (-<no>subcortseg)\r\n\r\nThis is done in six stages. (1) GCA linear registration\r\n(-gcareg). This is an initial registration to a template. (2)\r\nCanonical Normalization (-canorm), (3) Canonical Registration\r\n(-careg). (4) Neck removal (-rmneck), (5) Registration, w\/skull\r\n(-skull-lta), and (6) Subcortical labeling (-calabel).\r\nThe stages are listed next.\r\n\r\nEM (GCA) Registration (-<no>gcareg)\r\n\r\nComputes transform to align the mri\/nu.mgz volume to the default GCA atlas\r\nfound in FREESURFER_HOME\/average (see -gca flag for more info).\r\nCreates the file mri\/transforms\/talairach.lta.\r\nThe -autorecon2 stage starts here.\r\n\r\nCA Normalize (-<no>canorm)\r\n\r\nFurther normalization, based on GCA model.\r\nCreates mri\/norm.mgz.\r\nNote: -canorm-usecps will enable usage of control points during normalization.\r\n\r\nCA Register (-<no>careg)\r\n\r\nComputes a nonlinear transform to align with GCA atlas.\r\nCreates the file mri\/transform\/talairach.m3z.\r\n\r\nRemove neck (-<no>rmneck)\r\n\r\nThe neck region is removed from the NU-corrected volume mri\/nu.mgz.\r\nMakes use of transform computed from prior CA Register stage.\r\nCreates the file mri\/nu_noneck.mgz.\r\n\r\nEM Registration, with Skull (-<no>skull-lta)\r\n\r\nComputes transform to align volume mri\/nu_noneck.mgz with GCA volume\r\npossessing the skull.\r\nCreates the file mri\/transforms\/talairach_with_skull_2.lta.\r\n\r\nCA Label (-<no>calabel)\r\n\r\nLabels subcortical structures, based in GCA model.\r\nCreates the files mri\/aseg.auto.mgz and mri\/aseg.presurf.mgz.\r\n\r\nASeg Stats (-<no>segstats)\r\n\r\nComputes statistics on the segmented subcortical structures found\r\nin mri\/aseg.mgz. Writes output to file stats\/aseg.stats.\r\n\r\nNormalization2 (-<no>normalization)\r\n\r\nPerforms a second (major) intensity correction using only the brain\r\nvolume as the input (so that it has to be done after the skull strip).\r\nIntensity normalization works better when the skull has been removed.\r\nCreates a new brain.mgz volume. The -autorecon2-cp stage begins here.\r\nIf -noaseg flag is used, then aseg.presurf.mgz is not used by mri_normalize.\r\n\r\nWM Segmentation (-<no>segmentation)\r\n\r\nAttempts to separate white matter from everything else. The input is\r\nmri\/brain.mgz, and the output is mri\/wm.mgz.  Uses intensity,\r\nneighborhood, and smoothness constraints.  This is the volume that is\r\nedited when manually fixing defects. Calls mri_segment,\r\nmri_edit_wm_with_aseg, and mri_pretess. To keep previous edits, run\r\nwith -keep. If -noaseg is used, them mri_edit_wm_aseg is skipped.\r\n\r\nCut\/Fill (-<no>fill)\r\n\r\nThis creates the subcortical mass from which the orig surface is\r\ncreated. The mid brain is cut from the cerebrum, and the hemispheres\r\nare cut from each other. The left hemisphere is binarized to 255.\r\nThe right hemisphere is binarized to 127.  The input is mri\/wm.mgz\r\nand the output is mri\/filled.mgz. Calls mri_fill. If the cut fails,\r\nthen seed points can be supplied (see -cc-crs, -pons-crs, -lh-crs,\r\n-rh-crs). The actual points used for the cutting planes in the\r\ncorpus callosum and pons can be found in scripts\/ponscc.cut.log.\r\nThe stage -autorecon2-wm begins here.  This is the last stage of\r\nvolumetric processing. If -noaseg is used, then aseg.presurf.mgz is \r\nnot used by mri_fill.\r\n\r\nTessellation (-<no>tessellate)\r\n\r\nThis is the step where the orig surface (ie, surf\/?h.orig.nofix) is\r\ncreated. The surface is created by covering the filled hemisphere with\r\ntriangles. Runs mri_tessellate. The places where the points of the\r\ntriangles meet are called vertices. Creates the file surf\/?h.orig.nofix\r\nNote: the topology fixer will create the surface ?h.orig.\r\n\r\nOrig Surface Smoothing (-<no>smooth1, -<no>smooth2)\r\n\r\nAfter tesselation, the orig surface is very jagged because each\r\ntriangle is on the edge of a voxel face and so are at right angles to\r\neach other. The vertex positions are adjusted slightly here to reduce\r\nthe angle. This is only necessary for the inflation processes.\r\nCreates surf\/?h.smoothwm(.nofix). Calls mris_smooth. Smooth1 is the step\r\njust after tessellation, and smooth2 is the step just after topology\r\nfixing.\r\n\r\nInflation (-<no>inflate1, -<no>inflate2)\r\n\r\nInflation of the surf\/?h.smoothwm(.nofix) surface to create\r\nsurf\/?h.inflated. The inflation attempts to minimize metric distortion\r\nso that distances and areas are perserved (ie, the surface is not\r\nstretched). In this sense, it is like inflating a paper bag and not a\r\nballoon.  Inflate1 is the step just after tessellation, and inflate2\r\nis the step just after topology fixing. Calls mris_inflate. Creates\r\n?h.inflated, ?h.sulc, ?h.curv, and ?h.area.\r\n\r\nQSphere (-<no>qsphere)\r\n\r\nThis is the initial step of automatic topology fixing. It is a\r\nquasi-homeomorphic spherical transformation of the inflated surface designed\r\nto localize topological defects for the subsequent automatic topology fixer.\r\nCalls mris_sphere. Creates surf\/?h.qsphere.nofix.\r\n\r\nAutomatic Topology Fixer (-<no>fix)\r\n\r\nFinds topological defects (ie, holes in a filled hemisphere) using\r\nsurf\/?h.qsphere.nofix, and changes the orig surface (surf\/?h.orig.nofix)\r\nto remove the defects. Changes the number of vertices.  All the defects\r\nwill be removed, but the user should check the orig surface in the volume\r\nto make sure that it looks appropriate. Calls mris_topo_fixer.\r\nCreates surf\/?h.orig (by iteratively fixing surf\/?h.orig.nofix).\r\n\r\nWhite Surface (-<no>white)\r\n\r\nCreates the ?h.white surfacees as well as the curvature file (?h.curv).\r\nThe white surface is created by \"nudging\" the orig surface so that it\r\nclosely follows the white-gray intensity gradient as found in the T1 volume.\r\nCalls mris_make_surfaces.  See also \"Pial Surface\" and \"Final Surfaces\".\r\n\r\nSpherical Inflation (-<no>sphere)\r\n\r\nInflates the orig surface into a sphere while minimizing metric\r\ndistortion.  This step is necessary in order to register the surface\r\nto the spherical atlas. (also known as the spherical morph). Calls\r\nmris_sphere. Creates surf\/?h.sphere.  The -autorecon3 stage begins here.\r\n\r\nIpsilateral Surface Registation (Spherical Morph) (-<no>surfreg)\r\n\r\nRegisters the orig surface to the spherical atlas through\r\nsurf\/?h.sphere. The surfaces are first coarsely registered by aligning\r\nthe large scale folding patterns found in ?h.sulc and then fine tuned\r\nusing the small-scale patterns as in ?h.curv.\r\nCalls mris_register. Creates surf\/?h.sphere.reg.\r\n\r\nJacobian (-<no>jacobian_white)\r\n\r\nComputes how much the white surface was distorted in order to register\r\nto the spherical atlas during the -surfreg step. Creates ?h.jacobian_white\r\n(a curv formatted file). This step follows the surface registration step.\r\n\r\nSurface Registation, maximal distortion, with Jacobian (-<no>jacobian_dist0)\r\n\r\nRun spherical registration with no metric distortion penalty. This will\r\ncause surface geometry to align regardless of the amount of distortion\r\ninduced (ie, distance contraints are turned off). The distortion will then\r\nbe quantified by the Jacobian of the transform. Creates ?h.jacobian_dist0 (a\r\ncurv formatted file) and ?h.sphere.dist0.jacobian.reg (a surface file). This\r\nstep is not run automatically because it can add about an hour per hemi.\r\nNote: the file ?h.jacobian_white (see prior help text) is the Jacobian of\r\nthe white surface to spherical atlas alignment from -surfreg.\r\n\r\nContralateral Surface Registation (Spherical Morph) (-<no>contrasurfreg)\r\n\r\nSame as ipsilateral but registers to the contralateral atlas.\r\nCreates lh.rh.sphere.reg and rh.lh.sphere.reg.\r\n\r\nAverage Curvature (-<no>avgcurv)\r\n\r\nResamples the average curvature from the atlas to that of the subject.\r\nAllows the user to display activity on the surface of an individual\r\nwith the folding pattern (ie, anatomy) of a group. Calls mrisp_paint.\r\nCreates surf\/?h.avg_curv.\r\n\r\nCortical Parcellation (-<no>cortparc, -<no>cortparc2, -<no>cortparc3 )\r\n\r\nAssigns a neuroanatomical label to each location on the cortical surface.\r\nIncorporates both geometric information derived from the cortical model\r\n(sulcus and curvature), and neuroanatomical convention.\r\nCalls mris_ca_label.  -cortparc creates label\/?h.aparc.annot,\r\n-cortparc2 creates \/label\/?h.aparc.a2009s.annot, and\r\n-cortparc3 creates \/label\/?h.aparc.DKTatlas40.annot.\r\n\r\nPial Surface (-<no>pial)\r\n\r\nCreates the ?h.pial surfaces as well as the thickness file (?h.thickness).\r\nThe pial surface is created by expanding the white surface so that it closely\r\nfollows the gray-CSF intensity gradient as found in the T1 volume.  The\r\ncortical parcellation is also used to refine the surface in certain areas.\r\nCalls mris_make_surfaces.  See also \"Final Surfaces\".\r\n\r\nFinal Surfaces (-<no>finalsurfs)\r\n\r\n!!! DEPRECATED !!! This flag is intended to emulate the old-style single-run\r\nmris_make_surfaces, where the white and pial surfaces are created at the same\r\ntime without aid from the cortical parcellation data.\r\n\r\nWM\/GM Contrast (-<no>pctsurfcon)\r\n\r\nComputes the vertex-by-vertex percent contrast between white and gray matter.\r\nThe computation is:\r\n\r\n         100*(W-G)\r\n   pct = ---------\r\n         0.5*(W+G)\r\n\r\nThe white matter is sampled 1mm below the white surface. The gray matter is\r\nsampled 30% the thickness into the cortex. The volume that is sampled is\r\nrawavg.mgz.  The output is stored in the surf dir of the given subject as\r\n?h.w-g.pct.mgh.  Non-cortical regions (medial wall) are zeroed.\r\nA stats file named ?h.w-g.pct.stats is also computed.\r\n\r\nSurface Volume (-surfvolume)\r\n\r\nCreates the ?h.volume file by first creating the ?h.mid.area file by\r\nadding ?h.area(.white) to ?h.area.pial, then dividing by two.  Then\r\n?h.volume is created by multiplying ?.mid.area with ?h.thickness.\r\nThis step is also run at the end of the -pial step.\r\n\r\nCortical Ribbon Mask (-<no>cortribbon)\r\n\r\nCreates binary volume masks of the cortical ribbon, ie, each voxel is\r\neither a 1 or 0 depending upon whether it falls in the ribbon or not.\r\nSaved as ?h.ribbon.mgz.  Uses mgz regardless of whether the -mgz\r\noption is used.\r\n\r\nParcellation Statistics (-<no>parcstats, -<no>parcstats2, -<no>parcstats3)\r\n\r\nRuns mris_anatomical_stats to create a summary table of cortical\r\nparcellation statistics for each structure, including 1. structure\r\nname 2. number of vertices 3. total wm surface area (mm^2) 4. total gray\r\nmatter volume (mm^3) 5. average cortical thickness (mm) 6. standard\r\nerror of cortical thickness (mm) 7. integrated rectified mean wm\r\ncurvature 8. integrated rectified Gaussian wm curvature 9. folding index\r\n10. intrinsic curvature index.\r\nFor -parcstats, the file is saved in stats\/?h.aparc.stats.\r\nFor -parcstats2, the file is saved in stats\/?h.aparc.${DESTRIEUX_NAME}.stats.\r\nFor -parcstats3, the file is saved in stats\/?h.aparc.${DKTATLAS_NAME}.stats.\r\n\r\nCurvature Statistics  (-<no>curvstats)\r\n\r\nRuns mris_curvature_stats to create a summary file (stats\/?h.curv.stats)\r\nof cortical curvature statistics.\r\n\r\nLONGITUDINAL PROCESSING\r\n\r\nThe longitudinal processing scheme aims to incorporate the subject-wise\r\ncorrelation of longitudinal data into the processing stream in order to\r\nincrease sensitivity and repeatability, see [14-16]. Care is taken to\r\navoid introduction of asymmetry-induced bias.\r\n\r\nHere is a summary of the longitudinal workflow, where tpN refers to the\r\nname of one timepoint of subject data, and longbase refers to the name\r\ngiven to the base subject of a collection of timepoints:\r\n\r\n1) cross-sectionally process tpN subjects (the default workflow):\r\n  recon-all -s tp1 -i path_to_tp1_dicom -all\r\n  recon-all -s tp2 -i path_to_tp2_dicom -all\r\n\r\n2) create and process the unbiased base (subject template):\r\n  recon-all -base longbase -tp tp1 -tp tp2 -all\r\n\r\n3) longitudinally process tpN subjects:\r\n  recon-all -long tp1 longbase -all\r\n  recon-all -long tp2 longbase -all\r\n\r\n4) do comparisons on results from 3), e.g. calculate differences\r\nbetween tp2.long.longbase - tp1.long.longbase\r\n\r\nNote that the longitudinal processing stream always produces output subject\r\ndata containing  .long.  in the name (to help distinguish from the default\r\nstream).\r\n\r\nNotice that the -all flag is included in the -base and -long calls above.\r\nA work directive flag is required.\r\n\r\nOther flags:\r\n\r\n-uselongbasectrlvol\r\n\r\nWith -long: Switch on use of control-points from the base in the long\r\nruns for intensity normalization (T1.mgz).\r\n\r\n-uselongbasewmedits\r\n\r\nWith -long: Optionally transfer WM edits from base\/template.\r\nDefault: map WM edits from corresponding cross run.\r\n\r\n-no-orig-pial\r\n\r\nIf the orig pial surface data is not available, then specify this flag so that\r\nmris_make_surfaces does not attempt to use it.\r\n\r\n-noasegfusion\r\n\r\nDo not create 'fused' aseg from the longbase timepoints, which would normally\r\nbe used to initialize the ca_labeling.  Instead, initialize using the longbase\r\naseg.mgz.\r\n\r\n-addtp\r\n\r\nIf a new timepoint needs to be added to a longitudinal run where a base subject\r\nhas already been created (from prior timepoints), then the -addtp command\r\ncan be added to the -long command in order to 'fix-up' the longitudinal\r\nstream to accept the new timepoint. Note that the base subject is *not*\r\nrecomputed using the new timepoint. This potentially introduces a bias, and it\r\nis recommended to NOT add a time point this way! Instead recreate the base\r\nfrom all time points and run all longitudinals again.\r\nSee the LongitudinalProcessing wiki page.\r\n\r\nExample:\r\n\r\n  recon-all -long <tpNsubjid> <longbasesubjid> -addtp -all\r\n\r\nIn this example, 'tnNsubjid' is the subject name (assumed processed in the\r\ncross-sectional stream) to add as a new timepoint and upon which to run\r\nthe longitudinal stream (creating <tpNsubjid>.long.<longbasesubjid>).\r\n\r\n\r\n\r\nUSING IMAGES FROM A 3T SCANNER \r\n\r\nThe -3T flag enables two specific options in recon-all for images acquired with\r\na 3T scanner:  3T-specific NU intensity correction parameters are used in the \r\nNon-Uniform normalization stage, and the Schwartz 3T atlas is used for \r\nTalairach alignment.\r\n\r\n\r\nT2 OR FLAIR TO IMPROVE PIAL SURFACES\r\n\r\nPial surfaces can be improved using the different contrast in T2 or FLAIR\r\nimages. The original pial surfaces without T2\/FLAIR data are saved as  \r\n?h.woT2.pial or ?h.woFLAIR.pial, and new ?h.pial surfaces are created.  One \r\nexample where this is useful is when there is dura in the brainmask.mgz that \r\nisn't removed by skull stripping. The flags for these commands are:\r\n\r\n  -T2 <input T2 volume>  or -FLAIR <input FLAIR volume> \r\n    (Specify the  path to the T2 or FLAIR image to use)\r\n  -T2pial or -FLAIRpial \r\n    (Create new pial surfaces using T2 or FLAIR images)\r\n\r\nAn example of running a subject through Freesurfer with a T2 image is:\r\n  \r\n  recon-all -s subjectname -i \/path\/to\/input -T2 \/path\/to\/T2_input -T2pial -all\r\n\r\nT2 or FLAIR images can also be used with Freesurfer subjects that have already\r\nbeen processed without them. Note that autorecon3 should also be re-ran to \r\ncompute statistics based on the new surfaces. For example:\r\n  \r\n  recon-all -s subjectname -T2 \/path\/to\/T2_volume -T2pial -autorecon3\r\n\r\n\r\nMANUAL CHECKING AND EDITING OF SURFACES\r\n\r\nTo manually edit segmenation, run the following command (make sure\r\nthat your SUBJECTS_DIR environment variable is properly set).\r\n\r\n  tkmedit subjid wm.mgz -aux T1.mgz\r\n\r\nThe surfaces can be loaded through the menu item\r\nFile->LoadMainSurface. To enable editing, set Tools->EditVoxels.  It\r\nmay also be convenient to bring up the reconstruction toolbar with\r\nView->ToolBars->Reconstruction. Alt-C toggles between the main (wm)\r\nand auxiliary (T1) volumes. Middle clicking will set a voxel value to\r\n255; left clicking will set a voxel value to 0. Only edit the wm\r\nvolume. When finished, File->SaveMainVolume.\r\n\r\nTo view the inflated surface simultaneosly with the volume, run the\r\nfollowing command from a different shell:\r\n\r\n  tksurfer subjid lh inflated\r\n\r\nTo goto a point on the surface inside the volume, click on the point\r\nand hit SavePoint (icon looks like a floppy disk), then, in tkmedit,\r\nhit GotoSavedPoint (icon looks like an open file).\r\n\r\nBe sure to see the tutorials found at:\r\nhttps:\/\/surfer.nmr.mgh.harvard.edu\/fswiki\/FsTutorial\r\n\r\n\r\nTOUCH FILES\r\n\r\nThis script creates a directory called \"touch\". Each time a stage is\r\nrun a \"touch file\" is created (eg, skull_strip.touch). This will be\r\nused in the future to automatically determine which stages need to be\r\nrun or re-run. The modification time of the touch file is important.\r\nThe content is irrelevent, though it often contains a command-line.\r\n\r\n\r\nFLATTENING\r\n\r\nFlattening is not actually done in this script. This part just documents\r\nhow one would go about performing the flattening. First, load the subject\r\nsurface into tksurfer:\r\n\r\n  tksurfer subjid lh inflated\r\n\r\nLoad the curvature through the File->Curvature->Load menu (load\r\nlh.curv). This should show a green\/red curvature pattern. Red = sulci.\r\n\r\nRight click before making a cut; this will clear previous points. This\r\nis needed because it will string together all the previous places you\r\nhave clicked to make the cut. To make a line cut, left click on a line\r\nof points. Make the points fairly close together; if they are too far\r\nappart, the cut fails. After making your line of points, execute the\r\ncut by clicking on the Cut icon (scissors with an open triangle for a\r\nline cut or scissors with a closed triangle for a closed cut). To make\r\na plane cut, left click on three points to define the plane, then left\r\nclick on the side to keep. Then hit the CutPlane icon.\r\n\r\nFill the patch. Left click in the part of the surface that you want to\r\nform your patch. Then hit the Fill Uncut Area button (icon = filled\r\ntriangle). This will fill the patch with white. The non-patch area\r\nwill be unaccessible through the interface.  Save the patch through\r\nFile->Patch->SaveAs. For whole cortex, save it to something like\r\nlh.cort.patch.3d. For occipital patches, save it to lh.occip.patch.3d.\r\n\r\nCd into the subject surf directory and run\r\n\r\n  mris_flatten -w N -distances Size Radius lh.patch.3d lh.patch.flat\r\n\r\nwhere N instructs mris_flatten to write out an intermediate surface\r\nevery N interations. This is only useful for making movies; otherwise\r\nset N=0.  Size is maximum number of neighbors; Radius radius (mm) in\r\nwhich to search for neighbors. In general, the more neighbors that are\r\ntaken into account, the less the metric distortion but the more\r\ncomputationally intensive. Typical values are Size=12 for large\r\npatches, and Size=20 for small patches. Radius is typically 7.\r\nNote: flattening may take 12-24 hours to complete. The patch can be\r\nviewed at any time by loading the subjects inflated surface, then\r\nloading the patch through File->Patch->LoadPatch...\r\n\r\n\r\nGETTING HELP\r\n\r\nSee https:\/\/surfer.nmr.mgh.harvard.edu\r\nSend email to freesurfer@nmr.mgh.harvard.edu\r\n\r\n\r\nREFERENCES\r\n\r\nSee https:\/\/www.zotero.org\/freesurfer\r\n\r\n[1] Collins, DL, Neelin, P., Peters, TM, and Evans, AC. (1994)\r\nAutomatic 3D Inter-Subject Registration of MR Volumetric Data in\r\nStandardized Talairach Space, Journal of Computer Assisted Tomography,\r\n18(2) p192-205, 1994 PMID: 8126267; UI: 94172121\r\n\r\n[2] Cortical Surface-Based Analysis I: Segmentation and Surface\r\nReconstruction Dale, A.M., Fischl, Bruce, Sereno, M.I.,\r\n(1999). Cortical Surface-Based Analysis I: Segmentation and Surface\r\nReconstruction.  NeuroImage 9(2):179-194\r\n\r\n[3] Fischl, B.R., Sereno, M.I.,Dale, A. M.  (1999) Cortical\r\nSurface-Based Analysis II: Inflation, Flattening, and Surface-Based\r\nCoordinate System. NeuroImage, 9, 195-207.\r\n\r\n[4] Fischl, Bruce, Sereno, M.I., Tootell, R.B.H., and Dale, A.M.,\r\n(1999). High-resolution inter-subject averaging and a coordinate\r\nsystem for the cortical surface. Human Brain Mapping, 8(4): 272-284\r\n\r\n[5] Fischl, Bruce, and Dale, A.M., (2000).  Measuring the Thickness of\r\nthe Human Cerebral Cortex from Magnetic Resonance Images.  Proceedings\r\nof the National Academy of Sciences, 97:11044-11049.\r\n\r\n[6] Fischl, Bruce, Liu, Arthur, and Dale, A.M., (2001). Automated\r\nManifold Surgery: Constructing Geometrically Accurate and\r\nTopologically Correct Models of the Human Cerebral Cortex. IEEE\r\nTransactions on Medical Imaging, 20(1):70-80\r\n\r\n[7] Non-Uniform Intensity Correction.\r\nhttp:\/\/www.nitrc.org\/projects\/nu_correct\/\r\n\r\n[8] Fischl B, Salat DH, Busa E, Albert M, Dieterich M, Haselgrove C,\r\nvan der Kouwe A, Killiany R, Kennedy D, Klaveness S, Montillo A,\r\nMakris N, Rosen B, Dale AM. Whole brain segmentation: automated\r\nlabeling of neuroanatomical structures in the human\r\nbrain. Neuron. 2002 Jan 31;33(3):341-55.\r\n\r\n[9] Bruce Fischl, Andre van der Kouwe, Christophe Destrieux, Eric\r\nHalgren, Florent Segonne, David H. Salat, Evelina Busa, Larry\r\nJ. Seidman, Jill Goldstein, David Kennedy, Verne Caviness, Nikos\r\nMakris, Bruce Rosen, and Anders M. Dale.  Automatically Parcellating\r\nthe Human Cerebral Cortex. Cerebral Cortex January 2004; 14:11-22.\r\n\r\n[10] Fischl B, Salat DH, van der Kouwe AJW, Makris N, S\u00e9gonne F, Dale\r\nAM. Sequence-Independent  Segmentation of Magnetic Resonance Images.\r\nNeuroImage 23 Suppl 1, S69-84.\r\n\r\n[11] Segonne F, Dale, AM, Busa E, Glessner M, Salvolini U, Hahn HK,\r\nFischl B, A Hybrid Approach to the Skull-Stripping Problem in MRI.\r\nNeuroImage, 22,  pp. 1160-1075, 2004\r\n\r\n[12] Han et al.,  Reliability of MRI-derived measurements of human\r\ncerebral cortical thickness: The effects of field strength, scanner\r\nupgrade and manufacturer, (2006) NeuroImage, 32(1):180-194.\r\n\r\n[13] Schaer et al., A Surface-based Approach to Quantify Local Cortical\r\nGyrification (2007) IEEE Transactions on Medical Imaging.\r\n\r\n[14] Martin Reuter, H Diana Rosas, Bruce Fischl.\r\nHighly Accurate Inverse Consistent Registration: A Robust Approach.\r\nNeuroImage 53(4), 1181-1196, 2010. http:\/\/dx.doi.org\/10.1016\/j.neuroimage.2010.07.020\r\n\r\n[15] Martin Reuter, Bruce Fischl.\r\nAvoiding Asymmetry-Induced Bias in Longitudinal Image Processing.\r\nNeuroImage 51(1), 19-21, 2011. http:\/\/dx.doi.org\/10.1016\/j.neuroimage.2011.02.076\r\n\r\n[16] Martin Reuter, Nicholas J Schmansky, H Diana Rosas, Bruce Fischl.\r\nWithin-Subject Template Estimation for Unbiased Longitudinal Image Analysis.\r\nNeuroImage 61(4), 1402-1418, 2012. http:\/\/dx.doi.org\/10.1016\/j.neuroimage.2012.02.084\r\n\r\n[17] Iglesias, J.E., Augustinack, J.C., Nguyen, K., Player, C.M., Player, A., Wright,\r\nM., Roy, N., Frosch, M.P., McKee, A.C., Wald, L.L., Fischl, B., and Van Leemput, K.,\r\nA computational atlas of the hippocampal formation using ex vivo, ultra-high resolution\r\nMRI: Application to adaptive segmentation of in vivo MRI.  Neuroimage 115, 2015, 117-137. \r\nhttp:\/\/dx.doi.org\/10.1016\/j.neuroimage.2015.04.042\r\n\r\n[18] Iglesias, J.E., Van Leemput, K., Bhatt, P., Casillas, C., Dutt, S., Schuff, N.,\r\nTruran-Sacrey, D., Boxer, A., and Fischl, B., Bayesian segmentation of brainstem \r\nstructures in MRI. Neuroimage 113, 2015, 184-195.\r\nhttp:\/\/dx.doi.org\/10.1016\/j.neuroimage.2015.02.065\r\n\r\n[19] Saygin, Z.M. & Kliemann, D. (joint 1st authors), Iglesias, J.E., van der Kouwe, A.J.W.,\r\nBoyd, E., Reuter, M., Stevens, A., Van Leemput, K., McKee, A., Frosch, M.P., Fischl, B.,\r\nand Augustinack, J.C., High-resolution magnetic resonance imaging reveals nuclei of the \r\nhuman amygdala: manual segmentation to automatic atlas. Neuroimage 155, 2017, 370-382.\r\nhttp:\/\/doi.org\/10.1016\/j.neuroimage.2017.04.046\r\n\r\n[20] Iglesias, J.E., Van Leemput, K., Augustinack, J., Insausti, R., Fischl, B., \r\nand Reuter, M., Bayesian longitudinal segmentation of hippocampal substructures in brain MRI\r\nusing subject-specific atlases. Neuroimage 141, 2016, 542-555. \r\nhttp:\/\/doi.org\/10.1016\/j.neuroimage.2016.07.020\r\n\r\n\r\n\r\n\r\n[dpane@mind-0-12 ~]$ \r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>FreeSurfer Software Suite is an open source software suite for processing and analyzing MRI images. Documentation can be found on the FreeSurfer Wiki. Example Interactive session: [dpane@mind ~]$ srun -p cpu &#8211;cpus-per-task=1 &#8211;mem=10GB &#8211;time=4:00:00 &#8211;pty bash [dpane@mind-0-12 ~]$ module avail &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; \/usr\/share\/Modules\/modulefiles &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; anaconda3 cudnn-9.2-7.6 git-2.30 null cuda-10.0 dot glx-indirect&#8230;<\/p>\n","protected":false},"author":1,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[11],"ht-kb-tag":[],"class_list":["post-107","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-software"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ni.cmu.edu\/computing\/wp-json\/wp\/v2\/ht-kb\/107","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ni.cmu.edu\/computing\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/ni.cmu.edu\/computing\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/ni.cmu.edu\/computing\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ni.cmu.edu\/computing\/wp-json\/wp\/v2\/comments?post=107"}],"version-history":[{"count":11,"href":"https:\/\/ni.cmu.edu\/computing\/wp-json\/wp\/v2\/ht-kb\/107\/revisions"}],"predecessor-version":[{"id":495,"href":"https:\/\/ni.cmu.edu\/computing\/wp-json\/wp\/v2\/ht-kb\/107\/revisions\/495"}],"wp:attachment":[{"href":"https:\/\/ni.cmu.edu\/computing\/wp-json\/wp\/v2\/media?parent=107"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/ni.cmu.edu\/computing\/wp-json\/wp\/v2\/ht-kb-category?post=107"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/ni.cmu.edu\/computing\/wp-json\/wp\/v2\/ht-kb-tag?post=107"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}