skull stripping


//Checking a skullstrip
  //using tkmedit
  tkmedit  brainmask.mgz -aux T1.mgz -surfs

  //using freeview
  cd to /Applications/freesurfer/subjects/

  freeview -v /mri/T1.mgz \
  /mri/brainmask.mgz \
  -f /surf/lh.white:edgecolor=yellow \
  /surf/lh.pial:edgecolor=red \
  /surf/rh.white:edgecolor=yellow \
  /surf/rh.pial:edgecolor=red


//fix using gcut
recon-all -skullstrip -clean-bm -gcut -subjid 
  //view gcut results
    tkmedit  T1.mgz -segmentation brainmask.gcuts.mgz
    //OR
    tkemdit  brainmask.gcuts.mgz -aux T1.mgz
  

//fix using watershed parameters
setenv SUBJECTS_DIR /path/to/your/data          //or 'source' instead of 'setenv' for bash
setenv WATERSHED_PREFLOOD_HEIGHTS '20 30 40 50' //use first two lines only if changing default
//watershed values (defaults are: 5, 10, 20, 30)
recon-all -multistrip -clean-bm -s  -no-isrunning


//manually edit
//Fix the skullstripping in the brainmask.mgz file
tkmedit  brainmask.mgz -aux T1.mgz
/*
tkmedit setup
Tools > Configure Brush info > Radius 4 > Circle > Close
Tools > Configure Volume Brush > Clone > Aux volume (for brush 2) >
  Close and then click “Edit voxel tools” square button
Option + Click = fill in
Cmd + Click = erase
Ctrl+1/Ctrl+2 = toggle to/from auxiliary
*/


//rerun autorecon
recon-all -autorecon-pial -subjid   //can use for pial surface recon (too much brain left behind)
//OR
recon-all -autorecon2 -autorecon3 -subjid   //can use for part of the brain had been cut out