2011-10-24

Deleting all FreeSurfer original files in surf folder

I need to delete, or purge, all original files in FreeSurfer's $subject/surf folder - because i only need my result files in that folder but not original ones.

Here is a Shell script that i hope to help others, who also need to do the same. Please replace SUBJECT by the subject ID. I assume you have already setup $SUBJECTD_DIR environment variable. You may also replace $D by a real path. You can also embed the script below into a loop block so you can process many surf folders at once.

#!/bin/sh
   $D=$SUBJECTS_DIR/SUBJECTID/surf
   echo $D
   rm $D/rh.smoothwm.C.crv
   rm $D/ rh.smoothwm.FI.crv
   rm $D/rh.smoothwm.H.crv
   rm $D/rh.smoothwm.K1.crv
   rm $D/rh.smoothwm.K2.crv
   rm $D/rh.smoothwm.K.crv
   rm $D/rh.smoothwm.nofix
   rm $D/rh.smoothwm.S.crv
   rm $D/rh.sphere
   rm $D/rh.sphere.reg
   rm $D/rh.sulc
   rm $D/rh.thickness
   rm $D/rh.volume
   rm $D/rh.white
   rm $D/lh.sphere
   rm $D/lh.sphere.reg
   rm $D/lh.sulc
   rm $D/lh.thickness
   rm $D/lh.volume
   rm $D/lh.white
   rm $D/rh.area
   rm $D/rh.area.mid
   rm $D/rh.area.pial
   rm $D/rh.avg_curv
   rm $D/rh.curv
   rm $D/rh.curv.pial
   rm $D/rh.defect_borders
   rm $D/rh.defect_chull
   rm $D/rh.defect_labels
   rm $D/rh.inflated
   rm $D/rh.inflated.H
   rm $D/rh.inflated.K
   rm $D/rh.inflated.nofix
   rm $D/rh.jacobian_white
  rm $D/rh.orig
  rm $D/rh.orig.nofix
  rm $D/rh.pial
  rm $D/rh.qsphere.nofix
  rm $D/rh.smoothwm
  rm $D/rh.smoothwm.BE.crv
  rm $D/lh.area
  rm $D/lh.area.mid
  rm $D/lh.area.pial
  rm $D/lh.avg_curv
  rm $D/lh.curv
  rm $D/lh.curv.pial
  rm $D/lh.defect_borders
  rm $D/lh.defect_chull
  rm $D/lh.defect_labels
  rm $D/lh.inflated
  rm $D/lh.inflated.H
  rm $D/lh.inflated.K
  rm $D/lh.inflated.nofix
  rm $D/lh.jacobian_white
  rm $D/lh.orig
  rm $D/lh.orig.nofix
  rm $D/lh.pial
  rm $D/lh.qsphere.nofix
  rm $D/lh.smoothwm
  rm $D/lh.smoothwm.BE.crv
  rm $D/lh.smoothwm.C.crv
  rm $D/lh.smoothwm.FI.crv
  rm $D/lh.smoothwm.H.crv
  rm $D/lh.smoothwm.K1.crv
  rm $D/lh.smoothwm.K2.crv
  rm $D/lh.smoothwm.K.crv
  rm $D/lh.smoothwm.nofix
  rm $D/lh.smoothwm.S.crv

No comments: