#!\bin/tcsh -f

set l = (MNIa_N27 MNI_N27 TT_N27)
set view = "+tlrc"

foreach inp ($l) 
   rm -f ${inp}_automask$view.???? >& /dev/null
   3dAutomask -prefix ${inp}_automask $inp$view
   IsoSurface  -o_ply ${inp}_OuterBrainSurface.ply \
               -input ${inp}_automask$view \
               -isocmask "-a ${inp}_automask+tlrc. -expr step(a)"
   rm -f ${inp}_automask$view.???? >& /dev/null
end
