Freesurfer notes

My freesurfer notes

http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/OutputData

http://surfer.nmr.mgh.harvard.edu/fswiki/TroubleshootingReconstruction

http://surfer.nmr.mgh.harvard.edu/fswiki/ReconAllTableStableV5.1

https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/Talairach

    1. To do a full reconstruction on well-behaved data:
    2. recon-all –subject subjectNumber –i /path/to/input/firstDicomFile.dcm –all
    3. or run it in parts. Replace –all with one/more of –autorecon1 -autorecon2 -autorecon3
    4. check the talairach output
    5. tkregister2 --s subjectNumber --fstal
      1. optionally, add --surfs to load the surfaces (if generated)
      2. if it chokes on the talairach transformation, or the alignment looks bad (e.g., corpus collosum badly aligned), run the alternative talairach, then re-run the job:
      3. recon-all –s subjectNumber –talairach –use-mritotal –clean-tal –tal-check
      4. recon-all –subject subjectNumber –all (don’t point to input data again)
      5. more info on bad talairachs here http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/Talairach
    6. check the skull stripping
    7. tkmedit subNum brainmask.mgz –aux T1.mgz –surfs
      1. red line is the pial surface (CSF- gray matter boundary); yellow line is the wm-gm boundary. Toggle them on and off by clicking the and buttons or ctl-p and ctl-m
      1. optionally, add –aseg at the end of the tkmedit command to also display the automatic volume segmentation. Toggle this on/off with the button or ctl-g
      2. alt-c lets you toggle the auxiliary (T1) on/off
      3. select display window, then arrow keys change slice
      4. adjust brightness and contrast to discern GM-WM : view->configure->brightness/contrast, or ctl-b if the tools window is in focus, or shift+left mouse in display window
      5. to add the cortical segmentation, choose file->load segmentation and browse to the aparc+aseg.mgz, then hit OK twice ( or pass -aseg at load)
      6. no skull should be present, and nothing should be missing from cerebellum or cortex
        1. if there is missing brain/cerebellum, increase the watershed threshold (>25)
        2. if there is extra stuff/skull, decrease the watershed threshold (<25)
        3. recon-all -skullstrip -wsthresh yourNewThreshold -clean-bm -no-wsgcaatlas -subjid subjectNumber
        4. then re-run the remainder of the recon job:
          1. recon-all -autorecon2 -autorecon3 -subjid subjectNumber
      7. see here to fix skull stripping
      8. http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/SkullStripFix
      9. http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/ControlPoints
    1. check the intensity normalization
    2. tkmedit subNum brainmask.mgz –aux T1.mgz –surfs
      1. WM should be close to 110 (value under “cursor” in the tools window)
    3. Check the white matter volume
    4. tkmedit subNum brainmask.mgz –aux wm.mgz –surfs
      1. use this to fix errors in the WM
      2. http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/WhiteMatterEdits
      3. make sure there that no non-WM is marked as WM (scrub it out of the mask)
      4. make sure ventricles are filled and not WM
      5. if changes were made, rerun parts 2&3:
      6. recon-all –autorecon2-wm –autorecon3 –subject subNum
    5. check the pial surface
      1. GM often extends into the dura/skull/fat. Scrub the offending areas from the skull-stripped brain. See here for more help http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/PialEdits
      2. Save the changes and rerun parts 2&3 (3 happens automatically with the -pial):
      3. recon-all –subject subNum –autorecon-pial
    6. alternatively, check WM and pial surfaces with
      1. tkmedit subNum wm.mgz rh.white –aux brain.mgz (repeat with lh)
      2. WM edits: http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/WhiteMatterEdits
      3. Pial edits: http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/PialEdits
      4. Final surface edits: http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/FinalSurfEx
    7. check surfaces (all commands shown with left hemisphere. Repeat with rh for right hemisphere)
      1. tksurfer subNum lh inflated -gray
      2. helpful to see if the WM volume needs to be edited (i.e., if you see non-smoothness, holes, bumps, or other defects)
    8. switch to the pial surface, then white surface and inspect them
      1. view labels of cortical parcellations with file->label->import annotation and browse for lh.aparc.annot
    9. cut and flatten patches (example for the occipital pole for retinotopy)
      1. cut a line along the lateral surface by clicking 3 or 4 times, then pushing the "cut line" button. This cuts a split line for the flattening process. I prefer this split on the lateral side rather than along the calcarine. If you want to cut along the calcarine, just substitute "medial" for "lateral" and vice versa.
      2. Define the plane to cut by clicking four points (3 define the plane and the 4th says which side of the plane to keep):
        1. a point at the anterior end of your cut line
        2. a point on the anterior end of the calcarine
        3. a point on the superior surface in between the first two
        4. anywhere inside the patch
      3. click the "cut plane" buttong
      4. save the patch (File-->patch-->save as)
        1. ?h.occip.patch.3d
      5. Exit tksurfer. Flatten the patch at the command line with:
        1. mris_flatten /path/to/my.patch.3d /path/to/my.patch.flat
    10. if you run tkmedit in one terminal window and tksurfer in another, they will be linked, clunkily via saved points