#! /bin/tcsh -ef
cd $SUBJECTS_DIR
source $SUBJECTS_DIR/scripts/subjects.csh

set LH_LABELS=( \
  --l lh.bankssts.label \
  --l lh.caudalanteriorcingulate.label \
  --l lh.caudalmiddlefrontal.label \
  --l lh.corpuscallosum.label \
  --l lh.cuneus.label \
  --l lh.entorhinal.label \
  --l lh.fusiform.label \
  --l lh.inferiorparietal.label \
  --l lh.inferiortemporal.label \
  --l lh.isthmuscingulate.label \
  --l lh.lateraloccipital.label \
  --l lh.lateralorbitofrontal.label \
  --l lh.lingual.label \
  --l lh.medialorbitofrontal.label \
  --l lh.middletemporal.label \
  --l lh.parahippocampal.label \
  --l lh.paracentral.label \
  --l lh.parsopercularis.label \
  --l lh.parsorbitalis.label \
  --l lh.parstriangularis.label \
  --l lh.pericalcarine.label \
  --l lh.postcentral.label \
  --l lh.posteriorcingulate.label \
  --l lh.precentral.label \
  --l lh.precuneus.label \
  --l lh.rostralanteriorcingulate.label \
  --l lh.rostralmiddlefrontal.label \
  --l lh.superiorfrontal.label \
  --l lh.superiorparietal.label \
  --l lh.superiortemporal.label \
  --l lh.supramarginal.label \
  --l lh.frontalpole.label \
  --l lh.temporalpole.label \
  --l lh.transversetemporal.label \
  --l lh.insula.label )

set RH_LABELS=( \
  --l rh.bankssts.label \
  --l rh.caudalanteriorcingulate.label \
  --l rh.caudalmiddlefrontal.label \
  --l rh.corpuscallosum.label \
  --l rh.cuneus.label \
  --l rh.entorhinal.label \
  --l rh.fusiform.label \
  --l rh.inferiorparietal.label \
  --l rh.inferiortemporal.label \
  --l rh.isthmuscingulate.label \
  --l rh.lateraloccipital.label \
  --l rh.lateralorbitofrontal.label \
  --l rh.lingual.label \
  --l rh.medialorbitofrontal.label \
  --l rh.middletemporal.label \
  --l rh.parahippocampal.label \
  --l rh.paracentral.label \
  --l rh.parsopercularis.label \
  --l rh.parsorbitalis.label \
  --l rh.parstriangularis.label \
  --l rh.pericalcarine.label \
  --l rh.postcentral.label \
  --l rh.posteriorcingulate.label \
  --l rh.precentral.label \
  --l rh.precuneus.label \
  --l rh.rostralanteriorcingulate.label \
  --l rh.rostralmiddlefrontal.label \
  --l rh.superiorfrontal.label \
  --l rh.superiorparietal.label \
  --l rh.superiortemporal.label \
  --l rh.supramarginal.label \
  --l rh.frontalpole.label \
  --l rh.temporalpole.label \
  --l rh.transversetemporal.label \
  --l rh.insula.label )

foreach s ($SUBJECTS)
  pushd $s/label

  rm lh.aparc_edited.annot
  mris_label2annot \
    --s $s \
    --h lh \
    $LH_LABELS \
    --ctab ../../scripts/colortable_final.txt \
    --a aparc_edited &

  rm rh.aparc_edited.annot
  mris_label2annot \
    --s $s \
    --h rh \
    $RH_LABELS \
    --ctab ../../scripts/colortable_final.txt \
    --a aparc_edited

  popd
end
