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
- To do a full reconstruction on well-behaved data:
- recon-all –subject subjectNumber –i /path/to/input/firstDicomFile.dcm –all
- or run it in parts. Replace –all with one/more of –autorecon1 -autorecon2 -autorecon3
- check the talairach output
- tkregister2 --s subjectNumber --fstal
- optionally, add --surfs to load the surfaces (if generated)
- 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:
- recon-all –s subjectNumber –talairach –use-mritotal –clean-tal –tal-check
- recon-all –subject subjectNumber –all (don’t point to input data again)
- more info on bad talairachs here http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/Talairach
- check the skull stripping
- tkmedit subNum brainmask.mgz –aux T1.mgz –surfs
- 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
- 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
- alt-c lets you toggle the auxiliary (T1) on/off
- select display window, then arrow keys change slice
- 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
- 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)
- no skull should be present, and nothing should be missing from cerebellum or cortex
- if there is missing brain/cerebellum, increase the watershed threshold (>25)
- if there is extra stuff/skull, decrease the watershed threshold (<25)
- recon-all -skullstrip -wsthresh yourNewThreshold -clean-bm -no-wsgcaatlas -subjid subjectNumber
- then re-run the remainder of the recon job:
- recon-all -autorecon2 -autorecon3 -subjid subjectNumber
- see here to fix skull stripping
- http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/SkullStripFix
- http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/ControlPoints
- check the intensity normalization
- tkmedit subNum brainmask.mgz –aux T1.mgz –surfs
- WM should be close to 110 (value under “cursor” in the tools window)
- Check the white matter volume
- tkmedit subNum brainmask.mgz –aux wm.mgz –surfs
- use this to fix errors in the WM
- http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/WhiteMatterEdits
- make sure there that no non-WM is marked as WM (scrub it out of the mask)
- make sure ventricles are filled and not WM
- if changes were made, rerun parts 2&3:
- recon-all –autorecon2-wm –autorecon3 –subject subNum
- check the pial surface
- 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
- Save the changes and rerun parts 2&3 (3 happens automatically with the -pial):
- recon-all –subject subNum –autorecon-pial
- alternatively, check WM and pial surfaces with
- tkmedit subNum wm.mgz rh.white –aux brain.mgz (repeat with lh)
- WM edits: http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/WhiteMatterEdits
- Pial edits: http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/PialEdits
- Final surface edits: http://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/FinalSurfEx
- check surfaces (all commands shown with left hemisphere. Repeat with rh for right hemisphere)
- tksurfer subNum lh inflated -gray
- helpful to see if the WM volume needs to be edited (i.e., if you see non-smoothness, holes, bumps, or other defects)
- switch to the pial surface, then white surface and inspect them
- view labels of cortical parcellations with file->label->import annotation and browse for lh.aparc.annot
- cut and flatten patches (example for the occipital pole for retinotopy)
- 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.
- Define the plane to cut by clicking four points (3 define the plane and the 4th says which side of the plane to keep):
- a point at the anterior end of your cut line
- a point on the anterior end of the calcarine
- a point on the superior surface in between the first two
- anywhere inside the patch
- click the "cut plane" buttong
- save the patch (File-->patch-->save as)
- ?h.occip.patch.3d
- Exit tksurfer. Flatten the patch at the command line with:
- mris_flatten /path/to/my.patch.3d /path/to/my.patch.flat
- if you run tkmedit in one terminal window and tksurfer in another, they will be linked, clunkily via saved points