#! /bin/csh -f 

set curr_dir = /autofs/space/pgolland_001/users/ythomas/caret_scripts/fs2caret/test_fs_caret_projection/
set caret_dir = /autofs/space/pgolland_001/users/ythomas/caret_scripts/fs2caret/
set fsaverage = /autofs/space/pgolland_001/users/ythomas/caret_scripts/fsaverage/

foreach hemi (lh rh)

    # convert file to caret format
    set cmd = "caret_command -file-convert -fsl2c ./${hemi}labels fsaverage/surf/$hemi.pial.asc $hemi.freesurferparc.paint"
    echo $cmd
    eval $cmd

    # deform file
    set cmd = "caret_command -deformation-map-apply ./FSaverage-to-PALS.$hemi.163842.deform_map PAINT $hemi.freesurferparc.paint $hemi.freesurferparc.PALS.paint"
    echo $cmd
    eval $cmd
end
