set echo = 1 ;
breaksw
breaksw
end
end
while ( $#argv != 0 )
while ( 0 != 0 )


goto parse_args_return ;
goto parse_args_return

if ( $DoSBatch ) then
if ( 0 ) then


if ( ! $?FS_ALLOW_FILLED_EDIT ) setenv FS_ALLOW_FILLED_EDIT 1
if ( ! 0 ) setenv FS_ALLOW_FILLED_EDIT 1
setenv FS_ALLOW_FILLED_EDIT 1

goto check_params ;
goto check_params

if ( $DoT2pial && $DoFLAIRpial ) then
if ( 0 && 0 ) then

if ( ! $DoVersionsOnly ) then
if ( ! 0 ) then
if ( $#subjid != 1 ) then
if ( 1 != 1 ) then

if ( ! $?SUBJECTS_DIR ) then
if ( ! 1 ) then

if ( ! -e $SUBJECTS_DIR ) then
if ( ! -e /home/ydong1/ADNI_100_redo4 ) then


pushd $SUBJECTS_DIR > /dev/null
pushd /home/ydong1/ADNI_100_redo4
setenv SUBJECTS_DIR `$PWD` ;
setenv SUBJECTS_DIR `$PWD`
/bin/pwd
popd > /dev/null
popd

set subjdir = $SUBJECTS_DIR/$subjid
set subjdir = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778
set mdir = $subjdir/mri
set mdir = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/mri
set sdir = $subjdir/surf
set sdir = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/surf
set ldir = $subjdir/label
set ldir = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/label
set tdir = $subjdir/touch
set tdir = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/touch

if ( $TH3Flag ) set TH3Opt = "-th3"
if ( 1 ) set TH3Opt = -th3
set TH3Opt = -th3
if ( ! $TH3Flag ) set TH3Opt = "-no-th3"
if ( ! 1 ) set TH3Opt = -no-th3

if ( $DoConf2Hires ) then
if ( 0 ) then

set fname = $subjdir/scripts/DoConf2Hires
set fname = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/DoConf2Hires
if ( -e $fname && ! $DoConf2Hires && ( $DoPialSurfs || $DoT2pial || $DoFLAIRpial ) ) then
if ( -e /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/DoConf2Hires && ! 0 && ( 0 || 0 || 0 ) ) then


if ( $EMRegStrip == 0 ) set GCASkull = RB_all_withskull_2019_10_22.talxfm.mni305.gca
if ( 1 == 0 ) set GCASkull = RB_all_withskull_2019_10_22.talxfm.mni305.gca
if ( $EMRegAseg == 0 ) set GCA = RB_all_2019_10_25.talxfm.mni305.gca
if ( 1 == 0 ) set GCA = RB_all_2019_10_25.talxfm.mni305.gca

if ( $DoCreateBaseSubj && ( $DoT2pial || $DoFLAIRpial ) ) then
if ( 0 && ( 0 || 0 ) ) then


if ( $longitudinal || $LongSamseg ) then
if ( 0 || 0 ) then
if ( $longitudinal && ! $LongSamseg ) then
if ( 0 && ! 0 ) then



set haslong = `echo $subjid | grep "\.long\."`
set haslong = `echo $subjid | grep "\.long\."`
grep \.long\.
echo ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778
set hasxhemi = `echo $subjid | grep xhemi`
set hasxhemi = `echo $subjid | grep xhemi`
echo ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778
grep xhemi
if ( "$haslong" != "" && "$hasxhemi" == "" ) then
if (  !=  &&  ==  ) then

endif
endif


if ( ! $DoCreateBaseSubj ) then
if ( ! 0 ) then
if ( -e $subjdir/$BaseSubjsListFname ) then
if ( -e /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/base-tps ) then
endif
endif


if ( $DoCreateBaseSubj && -e $subjdir ) then
if ( 0 && -e /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778 ) then

if ( $DoCreateBaseSubj ) then
if ( 0 ) then


if ( $#InputList == 0 ) then
if ( 1 == 0 ) then

if ( -e $subjdir ) then
if ( -e /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778 ) then
mkdir -p $subjdir
mkdir -p /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778
endif
endif
else
else

if ( ! $?FREESURFER_HOME ) then
if ( ! 1 ) then

if ( ! -e $FREESURFER_HOME ) then
if ( ! -e /expanse/community/sdsc/freesurfer7.2.0 ) then

if ( ! -e ${GCADIR}/$GCA ) then
if ( ! -e /expanse/community/sdsc/freesurfer7.2.0/average/RB_all_2020-01-02.gca ) then

if ( ! -e ${GCADIR}/$GCASkull && ( $DoSkullLTA || $DoSkullStrip ) ) then
if ( ! -e /expanse/community/sdsc/freesurfer7.2.0/average/RB_all_withskull_2020_01_02.gca && ( 0 || 0 ) ) then

foreach hemi ( $hemilist )
foreach hemi ( lh rh )
set avgtif = ${AvgCurvTifPath}/$hemi.${AvgCurvTif} ;
set avgtif = /expanse/community/sdsc/freesurfer7.2.0/average/lh.folding.atlas.acfb40.noaparc.i12.2016-08-02.tif
if ( ! -e $avgtif ) then
if ( ! -e /expanse/community/sdsc/freesurfer7.2.0/average/lh.folding.atlas.acfb40.noaparc.i12.2016-08-02.tif ) then
set GCSHemi = ${GCSDIR}/$hemi.$GCS
set GCSHemi = /expanse/community/sdsc/freesurfer7.2.0/average/lh.DKaparc.atlas.acfb40.noaparc.i12.2016-08-02.gcs
if ( ! -e $GCSHemi ) then
if ( ! -e /expanse/community/sdsc/freesurfer7.2.0/average/lh.DKaparc.atlas.acfb40.noaparc.i12.2016-08-02.gcs ) then
set CPAtlas = ${GCSDIR}/$hemi.$GCS
set CPAtlas = /expanse/community/sdsc/freesurfer7.2.0/average/lh.DKaparc.atlas.acfb40.noaparc.i12.2016-08-02.gcs
if ( ! -e $CPAtlas ) then
if ( ! -e /expanse/community/sdsc/freesurfer7.2.0/average/lh.DKaparc.atlas.acfb40.noaparc.i12.2016-08-02.gcs ) then
end
end
set avgtif = ${AvgCurvTifPath}/$hemi.${AvgCurvTif} ;
set avgtif = /expanse/community/sdsc/freesurfer7.2.0/average/rh.folding.atlas.acfb40.noaparc.i12.2016-08-02.tif
if ( ! -e $avgtif ) then
if ( ! -e /expanse/community/sdsc/freesurfer7.2.0/average/rh.folding.atlas.acfb40.noaparc.i12.2016-08-02.tif ) then
set GCSHemi = ${GCSDIR}/$hemi.$GCS
set GCSHemi = /expanse/community/sdsc/freesurfer7.2.0/average/rh.DKaparc.atlas.acfb40.noaparc.i12.2016-08-02.gcs
if ( ! -e $GCSHemi ) then
if ( ! -e /expanse/community/sdsc/freesurfer7.2.0/average/rh.DKaparc.atlas.acfb40.noaparc.i12.2016-08-02.gcs ) then
set CPAtlas = ${GCSDIR}/$hemi.$GCS
set CPAtlas = /expanse/community/sdsc/freesurfer7.2.0/average/rh.DKaparc.atlas.acfb40.noaparc.i12.2016-08-02.gcs
if ( ! -e $CPAtlas ) then
if ( ! -e /expanse/community/sdsc/freesurfer7.2.0/average/rh.DKaparc.atlas.acfb40.noaparc.i12.2016-08-02.gcs ) then
end
end

if ( $XOptsUse == 1 && $XOptsClean == 1 ) then
if ( 1 == 1 && 0 == 1 ) then

if ( $IsMPRAGE == 1 && $IsWashuMPRAGE == 1 ) then
if ( 1 == 1 && 0 == 1 ) then

mkdir -p $subjdir/scripts
mkdir -p /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts
set XOptsPreExist = $subjdir/scripts/expert-options
set XOptsPreExist = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/expert-options
if ( -e $XOptsPreExist ) then
if ( -e /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/expert-options ) then


if ( $#XOptsFile != 0 ) then
if ( 0 != 0 ) then
endif
endif

set GlobXOptsFile = $SUBJECTS_DIR/global-expert-options.txt
set GlobXOptsFile = /home/ydong1/ADNI_100_redo4/global-expert-options.txt
if ( -e $GlobXOptsFile ) then
if ( -e /home/ydong1/ADNI_100_redo4/global-expert-options.txt ) then

set GlobXOptsFile = ( )
set GlobXOptsFile = ( )
endif
endif

if ( $DoConf2Hires ) then
if ( 0 ) then

if ( $#NotifyFile != 0 ) then
if ( 0 != 0 ) then

if ( $#WaitForFile != 0 ) then
if ( 0 != 0 ) then

if ( $DoFill && ! $FS_ALLOW_FILLED_EDIT ) then
if ( 1 && ! 1 ) then


if ( ! $DoCleanTal && ! $DoCleanCP && ! $DoCleanBM && ! $DoConvertInput && ! $DoCleanASeg && ! $DoCleanWM && ! $DoCleanFilled && ! $DoCleanSeed && ! $DoCleanCW256 && ! $DoCortParc && ! $DoCortParc2 && ! $DoGCAReg && ! $DoMotionCor && ! $DoTalairach && ! $DoTalCheck && ! $DoCleanXopts && ! $DoNormalization && ! $DoNormalization2 && ! $DoParcStats && ! $DoParcStats2 && ! $DoVersionsOnly && ! $DoDeface && ! $DoCleanPFH && ! $DoSkullStrip && ! $DoSegmentation && ! $DoNuIntensityCor && ! $DoFill && ! $DoTessellate && ! $DoAParc2ASeg && ! $DoWMParc && ! $DoSmooth1 && ! $DoInflate1 && ! $DoQSphere && ! $DoRemoveNeck && ! $DoFix && ! $DoSmooth2 && ! $DoInflate2 && ! $DoSphere && ! $DoSkullLTA && ! $DoQdecCache && ! $DoVnoMatchCheck && ! $DoSurfReg && ! $DoAvgCurv && ! $DoSegStats && ! $DoMorphRGB && ! $DoAutoDetGWStats && ! $DoWhitePreAparc && ! $DoWhiteSurfs && ! $DoCortexLabel && ! $DoCortRibbonVolMask && ! $DoJacobianWhite && ! $DoJacobianDist0 && ! $DoCANormalize && ! $DoCAReg && ! $DoCALabel && ! $DoMaskBFS && ! $DoAParcASegStats && ! $DoLocalGyriIndex && ! $DoMakefile && ! $DoParallel && ! $DoRelabelHypos && ! $DoCurvHK && ! $DoSurfVolume && ! $DoASegMerge && ! $DoCCSeg && ! $DoCurvStats && ! $DoLabelV1 && ! $DoCreateBaseSubj && ! $DoBaLabels && ! $DoShowEdits && ! $DoLabelExvivoEC && ! $DoPialSurfs && ! $DoConf2Hires && ! $DoSubfields && ! $DoPctSurfCon && ! $DoT2pial && ! $DoFLAIRpial && ! $DoConvertT2Input && ! $DoConvertFlairInput && ! $DoSuperClean && ! $DoCortParc3 && ! $DoParcStats3 && ! $DoAPas2ASeg && ! $UseHighMyelin ) then
if ( ! 0 && ! 0 && ! 0 && ! 1 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 1 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 && ! 0 ) then

if ( $WSMore && $WSLess ) then
if ( 0 && 0 ) then

if ( ( $WSMore || $WSLess ) && $WSPctPreFlood ) then
if ( ( 0 || 0 ) && ) then

if ( $DoParallel == 1 && $#hemilist == 1 ) then
if ( 0 == 1 && 2 == 1 ) then


goto check_params_return ;
goto check_params_return

set StartTime = `date` ;
set StartTime = `date`
date
set tSecStart = `date '+%s'` ;
set tSecStart = `date '+%s'`
date +%s




if ( $?FS_RCA_T2_MASK_71 == 0 ) setenv FS_RCA_T2_MASK_71 1
if ( 0 == 0 ) setenv FS_RCA_T2_MASK_71 1
setenv FS_RCA_T2_MASK_71 1




if ( $?REQUIRE_FS_MATCH == 0 ) setenv REQUIRE_FS_MATCH 0
if ( 0 == 0 ) setenv REQUIRE_FS_MATCH 0
setenv REQUIRE_FS_MATCH 0

set bstampfile0 = $FREESURFER_HOME/build-stamp.txt
set bstampfile0 = /expanse/community/sdsc/freesurfer7.2.0/build-stamp.txt
mkdir -p $SUBJECTS_DIR/$subjid/scripts
mkdir -p /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts
set bstampfile = $SUBJECTS_DIR/$subjid/scripts/build-stamp.txt
set bstampfile = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/build-stamp.txt
if ( -e $bstampfile0 ) then
if ( -e /expanse/community/sdsc/freesurfer7.2.0/build-stamp.txt ) then
if ( ! -e $bstampfile ) cp $bstampfile0 $bstampfile
if ( ! -e /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/build-stamp.txt ) cp /expanse/community/sdsc/freesurfer7.2.0/build-stamp.txt /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/build-stamp.txt
cp /expanse/community/sdsc/freesurfer7.2.0/build-stamp.txt /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/build-stamp.txt
set bstamp0 = `cat $bstampfile0`
set bstamp0 = `cat $bstampfile0`
cat /expanse/community/sdsc/freesurfer7.2.0/build-stamp.txt
set bstamp = `cat $bstampfile`
set bstamp = `cat $bstampfile`
cat /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/build-stamp.txt
if ( "$bstamp0" != "$bstamp" ) then
if ( freesurfer-linux-centos8_x86_64-7.2.0-20210720-aa8f76b != freesurfer-linux-centos8_x86_64-7.2.0-20210720-aa8f76b ) then
echo "Subject Stamp: $bstamp"
echo Subject Stamp: freesurfer-linux-centos8_x86_64-7.2.0-20210720-aa8f76b
echo "Current Stamp: $bstamp0"
echo Current Stamp: freesurfer-linux-centos8_x86_64-7.2.0-20210720-aa8f76b
endif
endif
rm -f $SUBJECTS_DIR/$subjid/scripts/patchdir.txt
rm -f /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/patchdir.txt
if ( $?PatchDir ) then
if ( 1 ) then
echo "$PatchDir" > $SUBJECTS_DIR/$subjid/scripts/patchdir.txt
echo 
endif
endif
cp $bstampfile0 $SUBJECTS_DIR/$subjid/scripts/lastcall.build-stamp.txt
cp /expanse/community/sdsc/freesurfer7.2.0/build-stamp.txt /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/lastcall.build-stamp.txt

if ( $DoMakefile ) then
if ( 0 ) then

if ( $DoTime ) then
if ( 1 ) then
fs_time ls > & /dev/null
fs_time ls
if ( ! $status ) set fs_time= ( fs_time )
if ( ! 0 ) set fs_time= ( fs_time )
set fs_time= ( fs_time )
endif
endif

echo "INFO: SUBJECTS_DIR is $SUBJECTS_DIR"
echo INFO: SUBJECTS_DIR is /home/ydong1/ADNI_100_redo4


pushd $FREESURFER_HOME > /dev/null
pushd /expanse/community/sdsc/freesurfer7.2.0
set freesurfer_home_true = `pwd` ;
set freesurfer_home_true = `pwd`
pwd
popd > /dev/null
popd
echo "Actual FREESURFER_HOME $freesurfer_home_true"
echo Actual FREESURFER_HOME /expanse/community/sdsc/freesurfer7.2.0

set DateString = "`date '+%y%m%d%H%M'`"
set DateString = `date '+%y%m%d%H%M'`
date +%y%m%d%H%M


if ( $DoSuperClean ) then
if ( 0 ) then

cd $subjdir
cd /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778
mkdir -p mri scripts surf tmp label touch stats touch trash
mkdir -p mri scripts surf tmp label touch stats touch trash
mkdir -p mri/transforms mri/transforms/bak mri/orig
mkdir -p mri/transforms mri/transforms/bak mri/orig
set touchdir = $subjdir/touch
set touchdir = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/touch





rm -f scripts/recon-config.yaml scripts/unknown-args.txt
rm -f scripts/recon-config.yaml scripts/unknown-args.txt
cat $tmp_config > scripts/recon-config.yaml
cat /scratch/ydong1/job_30013376/tmp.IIU0uiGeyn
cat $tmp_unknown_args > scripts/unknown-args.txt
cat /scratch/ydong1/job_30013376/tmp.6IH8VZB5Ly
rm -f $tmp_config $tmp_unknown_args
rm -f /scratch/ydong1/job_30013376/tmp.IIU0uiGeyn /scratch/ydong1/job_30013376/tmp.6IH8VZB5Ly


if ( ! $DoVersionsOnly ) then
if ( ! 0 ) then
set CF = ( $subjdir/scripts/$CF_DEFAULT_NAME )
set CF = ( /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/recon-all.cmd )

echo "\n\n#---------------------------------" >> $CF
echo \n\n#---------------------------------
echo "# New invocation of recon-all `date` " >> $CF
echo # New invocation of recon-all `date` 
date

set ENVF = $subjdir/scripts/recon-all.env
set ENVF = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/recon-all.env
if ( -e $ENVF ) mv -f $ENVF $ENVF.bak
if ( -e /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/recon-all.env ) mv -f /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/recon-all.env /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/recon-all.env.bak
date >> $ENVF
date
echo "FREESURFER_HOME $FREESURFER_HOME" >> $ENVF
echo FREESURFER_HOME /expanse/community/sdsc/freesurfer7.2.0
echo "Actual FREESURFER_HOME $freesurfer_home_true" >> $ENVF
echo Actual FREESURFER_HOME /expanse/community/sdsc/freesurfer7.2.0
pwd >> $ENVF
pwd
echo "setenv SUBJECTS_DIR $SUBJECTS_DIR" >> $ENVF
echo setenv SUBJECTS_DIR /home/ydong1/ADNI_100_redo4
echo $inputargs >> $ENVF
echo -s ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778 -i ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778.nii -fill -debug
uname -a >> $ENVF
uname -a
echo "" >> $ENVF
echo 
limit >> $ENVF
limit
echo "" >> $ENVF
echo 
printenv >> $ENVF
printenv
endif
endif

if ( $DoVersionsOnly ) then
if ( 0 ) then


if ( $#LF == 0 ) then
if ( 0 == 0 ) then
set LF = ( $subjdir/scripts/$LF_DEFAULT_NAME )
set LF = ( /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/recon-all.log )
if ( -e $LF ) then
if ( -e /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/recon-all.log ) then
else
else
skip_new_invo:
skip_new_invo:

echo "" >> $LF
echo 
date >> $LF
date
echo "cd `$PWD`" >> $LF
echo cd `/bin/pwd`
/bin/pwd
echo "setenv SUBJECTS_DIR $SUBJECTS_DIR" >> $LF
echo setenv SUBJECTS_DIR /home/ydong1/ADNI_100_redo4
echo $0 $inputargs >> $LF
echo /expanse/community/sdsc/freesurfer7.2.0/bin/recon-all -s ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778 -i ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778.nii -fill -debug
echo "" >> $LF
echo 


if ( $?RECONALL_MAKE_SUBJECT ) goto skip_all_info
if ( 0 ) goto skip_all_info
echo "subjid $subjid" >> $LF
echo subjid ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778
echo "setenv SUBJECTS_DIR $SUBJECTS_DIR" >> $LF
echo setenv SUBJECTS_DIR /home/ydong1/ADNI_100_redo4
echo "FREESURFER_HOME $FREESURFER_HOME" >> $LF
echo FREESURFER_HOME /expanse/community/sdsc/freesurfer7.2.0
echo "Actual FREESURFER_HOME $freesurfer_home_true" >> $LF
echo Actual FREESURFER_HOME /expanse/community/sdsc/freesurfer7.2.0
if ( -e $FREESURFER_HOME/build-stamp.txt ) then
if ( -e /expanse/community/sdsc/freesurfer7.2.0/build-stamp.txt ) then
echo "build-stamp.txt: `cat $FREESURFER_HOME/build-stamp.txt`" >> $LF
echo build-stamp.txt: `cat /expanse/community/sdsc/freesurfer7.2.0/build-stamp.txt`
cat /expanse/community/sdsc/freesurfer7.2.0/build-stamp.txt
endif
endif
uname -a | tee -a $LF
uname -a
tee -a /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/recon-all.log
limit >> $LF
limit
if ( -e /usr/bin/free ) then
if ( -e /usr/bin/free ) then
echo "" >> $LF
echo 
/usr/bin/free --human >> $LF
/usr/bin/free --human
echo "" >> $LF
echo 
endif
endif
if ( "`uname -s`" == "Darwin" ) then
if ( `uname -s` == Darwin ) then
uname -s
if ( $?PBS_JOBID ) then
if ( 0 ) then
if ( $?SLURM_JOB_ID ) then
if ( 1 ) then
echo SLURM_JOB_ID $SLURM_JOB_ID >> $LF
echo SLURM_JOB_ID 30013376
endif
endif



set cmd = ( which bc )
set cmd = ( which bc )
$cmd > & /dev/null
which bc
if ( $status ) then
if ( 0 ) then


echo "########################################" >> $LF
echo ########################################
echo "program versions used" >> $LF
echo program versions used
echo $FS_RECON_VERSION >> $LF
echo 7.2.0 (freesurfer-linux-centos8_x86_64-7.2.0-20210720-aa8f76b)
set allinfocmds = ( lta_convert mri_and mri_annotation2label mri_aparc2aseg mri_surf2volseg mri_binarize mri_ca_label mri_ca_normalize mri_ca_register mri_cc mri_compute_overlap mri_compute_seg_overlap mri_concat mri_concatenate_lta mri_convert mri_diff mri_edit_wm_with_aseg mri_em_register mri_fill mri_fuse_segmentations mri_fwhm mri_gcut mri_info mri_label2label mri_label2vol mri_log_likelihood mri_mask mri_matrix_multiply mri_normalize mri_normalize_tp2 mri_or mri_relabel_hypointensities mri_relabel_nonwm_hypos mri_remove_neck mri_robust_register mri_robust_template mris_anatomical_stats mris_ca_label mris_calc mris_convert mris_curvature mris_curvature_stats mris_diff mris_divide_parcellation mri_segment mri_segstats mris_euler_number mris_fix_topology mris_topo_fixer mris_jacobian mris_label2annot mris_left_right_register mris_place_surface mrisp_paint mris_register mris_smooth mris_sphere mris_surface_stats mri_stats2seg mris_thickness mris_thickness_diff mris_topo_fixer mri_surf2surf mri_surf2vol mri_surfcluster mris_volmask mri_tessellate mri_vol2surf mri_vol2vol mri_voldiff mri_watershed tkregister2_cmdl )
set allinfocmds = ( lta_convert mri_and mri_annotation2label mri_aparc2aseg mri_surf2volseg mri_binarize mri_ca_label mri_ca_normalize mri_ca_register mri_cc mri_compute_overlap mri_compute_seg_overlap mri_concat mri_concatenate_lta mri_convert mri_diff mri_edit_wm_with_aseg mri_em_register mri_fill mri_fuse_segmentations mri_fwhm mri_gcut mri_info mri_label2label mri_label2vol mri_log_likelihood mri_mask mri_matrix_multiply mri_normalize mri_normalize_tp2 mri_or mri_relabel_hypointensities mri_relabel_nonwm_hypos mri_remove_neck mri_robust_register mri_robust_template mris_anatomical_stats mris_ca_label mris_calc mris_convert mris_curvature mris_curvature_stats mris_diff mris_divide_parcellation mri_segment mri_segstats mris_euler_number mris_fix_topology mris_topo_fixer mris_jacobian mris_label2annot mris_left_right_register mris_place_surface mrisp_paint mris_register mris_smooth mris_sphere mris_surface_stats mri_stats2seg mris_thickness mris_thickness_diff mris_topo_fixer mri_surf2surf mri_surf2vol mri_surfcluster mris_volmask mri_tessellate mri_vol2surf mri_vol2vol mri_voldiff mri_watershed tkregister2_cmdl )



foreach cmd ( $allinfocmds )
foreach cmd ( lta_convert mri_and mri_annotation2label mri_aparc2aseg mri_surf2volseg mri_binarize mri_ca_label mri_ca_normalize mri_ca_register mri_cc mri_compute_overlap mri_compute_seg_overlap mri_concat mri_concatenate_lta mri_convert mri_diff mri_edit_wm_with_aseg mri_em_register mri_fill mri_fuse_segmentations mri_fwhm mri_gcut mri_info mri_label2label mri_label2vol mri_log_likelihood mri_mask mri_matrix_multiply mri_normalize mri_normalize_tp2 mri_or mri_relabel_hypointensities mri_relabel_nonwm_hypos mri_remove_neck mri_robust_register mri_robust_template mris_anatomical_stats mris_ca_label mris_calc mris_convert mris_curvature mris_curvature_stats mris_diff mris_divide_parcellation mri_segment mri_segstats mris_euler_number mris_fix_topology mris_topo_fixer mris_jacobian mris_label2annot mris_left_right_register mris_place_surface mrisp_paint mris_register mris_smooth mris_sphere mris_surface_stats mri_stats2seg mris_thickness mris_thickness_diff mris_topo_fixer mri_surf2surf mri_surf2vol mri_surfcluster mris_volmask mri_tessellate mri_vol2surf mri_vol2vol mri_voldiff mri_watershed tkregister2_cmdl )
$cmd -all-info >> $LF
lta_convert -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_and -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_annotation2label -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_aparc2aseg -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_surf2volseg -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_binarize -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_ca_label -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_ca_normalize -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_ca_register -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_cc -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_compute_overlap -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_compute_seg_overlap -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_concat -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_concatenate_lta -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_convert -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_diff -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_edit_wm_with_aseg -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_em_register -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_fill -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_fuse_segmentations -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_fwhm -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_gcut -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_info -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_label2label -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_label2vol -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_log_likelihood -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_mask -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_matrix_multiply -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_normalize -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_normalize_tp2 -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_or -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_relabel_hypointensities -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_relabel_nonwm_hypos -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_remove_neck -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_robust_register -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_robust_template -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mris_anatomical_stats -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mris_ca_label -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mris_calc -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mris_convert -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mris_curvature -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mris_curvature_stats -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mris_diff -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mris_divide_parcellation -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_segment -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_segstats -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mris_euler_number -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mris_fix_topology -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mris_topo_fixer -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mris_jacobian -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mris_label2annot -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mris_left_right_register -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mris_place_surface -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mrisp_paint -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mris_register -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mris_smooth -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mris_sphere -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mris_surface_stats -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_stats2seg -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mris_thickness -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mris_thickness_diff -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mris_topo_fixer -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_surf2surf -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_surf2vol -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_surfcluster -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mris_volmask -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_tessellate -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_vol2surf -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_vol2vol -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_voldiff -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
mri_watershed -all-info
if ( $status ) then
if ( 0 ) then
end
end
$cmd -all-info >> $LF
tkregister2_cmdl -all-info
if ( $status ) then
if ( 0 ) then
end
end
mri_motion_correct.fsl -version >> $LF
mri_motion_correct.fsl -version

nu_correct -version >> $LF
nu_correct -version
nu_correct: Command not found.


if ( -e .xdebug_mris_curvature_stats ) rm -f .xdebug_mris_curvature_stats
if ( -e .xdebug_mris_curvature_stats ) rm -f .xdebug_mris_curvature_stats
if ( -e .xdebug_mris_calc ) rm -f .xdebug_mris_calc
if ( -e .xdebug_mris_calc ) rm -f .xdebug_mris_calc


echo "#######################################" >> $LF
echo #######################################
echo "GCADIR $GCADIR" >> $LF
echo GCADIR /expanse/community/sdsc/freesurfer7.2.0/average
echo "GCA $GCA" >> $LF
echo GCA RB_all_2020-01-02.gca
echo "GCASkull $GCASkull" >> $LF
echo GCASkull RB_all_withskull_2020_01_02.gca
echo "AvgCurvTif $AvgCurvTif" >> $LF
echo AvgCurvTif folding.atlas.acfb40.noaparc.i12.2016-08-02.tif
echo "GCSDIR $GCSDIR" >> $LF
echo GCSDIR /expanse/community/sdsc/freesurfer7.2.0/average
echo "GCS $GCS" >> $LF
echo GCS DKaparc.atlas.acfb40.noaparc.i12.2016-08-02.gcs
echo "#######################################" >> $LF
echo #######################################
skip_all_info:
skip_all_info:

if ( $DoVersionsOnly ) exit 0 ;
if ( 0 ) exit 0


set ErrorFile = $subjdir/scripts/recon-all.error
set ErrorFile = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/recon-all.error
rm -f $ErrorFile
rm -f /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/recon-all.error

if ( $#DoneFile == 0 ) then
if ( 0 == 0 ) then
set DoneFile = $subjdir/scripts/recon-all.done
set DoneFile = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/recon-all.done
rm -f $DoneFile
rm -f /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/recon-all.done
endif
endif


if ( $DoIsRunning ) then
if ( 1 ) then
set IsRunningLH = $subjdir/scripts/IsRunning.lh
set IsRunningLH = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/IsRunning.lh
set IsRunningRH = $subjdir/scripts/IsRunning.rh
set IsRunningRH = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/IsRunning.rh
set IsRunningLHRH = $subjdir/scripts/IsRunning.lh+rh
set IsRunningLHRH = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/IsRunning.lh+rh
set bailfile = ( ) ;
set bailfile = ( )
if ( $#hemilist == 1 ) then
if ( 2 == 1 ) then

set IsRunningFile = $subjdir/scripts/IsRunning.lh+rh
set IsRunningFile = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/IsRunning.lh+rh
if ( -e $IsRunningLH ) set bailfile = $IsRunningLH
if ( -e /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/IsRunning.lh ) set bailfile = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/IsRunning.lh
if ( -e $IsRunningRH ) set bailfile = $IsRunningRH
if ( -e /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/IsRunning.rh ) set bailfile = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/IsRunning.rh
endif
endif
if ( -e $IsRunningFile ) set bailfile = $IsRunningFile
if ( -e /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/IsRunning.lh+rh ) set bailfile = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/IsRunning.lh+rh
if ( $#bailfile ) then
if ( 0 ) then
echo "------------------------------" > $IsRunningFile
echo ------------------------------
echo "SUBJECT $subjid" >> $IsRunningFile
echo SUBJECT ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778
echo "HEMI    $hemilist" >> $IsRunningFile
echo HEMI    lh rh
echo "DATE `date`" >> $IsRunningFile
echo DATE `date`
date
echo "USER $user" >> $IsRunningFile
echo USER ydong1
echo "HOST `hostname`" >> $IsRunningFile
echo HOST `hostname`
hostname
echo "PROCESSID $$ " >> $IsRunningFile
echo PROCESSID 3196646 
echo "PROCESSOR `uname -m`" >> $IsRunningFile
echo PROCESSOR `uname -m`
uname -m
echo "OS `uname -s`" >> $IsRunningFile
echo OS `uname -s`
uname -s
uname -a >> $IsRunningFile
uname -a
echo $FS_RECON_VERSION >> $IsRunningFile
echo 7.2.0 (freesurfer-linux-centos8_x86_64-7.2.0-20210720-aa8f76b)
if ( $?PBS_JOBID ) then
if ( 0 ) then
endif
endif


set CSDF = $subjdir/scripts/csurfdir
set CSDF = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/csurfdir
if ( $DoCleanCSDF ) rm -vf $CSDF
if ( 0 ) rm -vf /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/csurfdir
if ( -e $CSDF ) then
if ( -e /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/csurfdir ) then


if ( $#SF == 0 ) then
if ( 0 == 0 ) then
set SF = ( $subjdir/scripts/$SF_DEFAULT_NAME )
set SF = ( /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/recon-all-status.log )
if ( -e $SF ) then
if ( -e /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/recon-all-status.log ) then
else
else
echo "status file for recon-all" >> $SF
echo status file for recon-all
date >> $SF
date


if ( "`uname -s`" == "Linux" ) then
if ( `uname -s` == Linux ) then
uname -s
set FullProgName = `readlink -f $0` ;
set FullProgName = `readlink -f $0`
readlink -f /expanse/community/sdsc/freesurfer7.2.0/bin/recon-all
cp $FullProgName $subjdir/scripts/recon-all.local-copy
cp /expanse/community/sdsc/freesurfer7.2.0/bin/recon-all /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/recon-all.local-copy
endif
endif


if ( $#WaitForFile != 0 ) then
if ( 0 != 0 ) then

if ( ! $RunIt ) then
if ( ! 1 ) then

if ( $DoRestart ) then
if ( 0 ) then




if ( $DoCleanSeed ) then
if ( 0 ) then
if ( $DoCleanCW256 ) then
if ( 0 ) then
if ( $DoCleanTal ) then
if ( 0 ) then
if ( $DoCleanLta ) then
if ( 0 ) then
if ( $DoCleanPFH ) then
if ( 0 ) then
if ( $DoCleanBM ) then
if ( 0 ) then
if ( $DoCleanASeg ) then
if ( 0 ) then
if ( $DoCleanWM ) then
if ( 0 ) then
if ( $DoCleanFilled ) then
if ( 0 ) then
if ( $DoCleanCP ) then
if ( 0 ) then
if ( $DoCleanTWM ) then
if ( 0 ) then
if ( $DoCleanBFSE ) then
if ( 0 ) then
if ( $DoCleanXopts ) then
if ( 0 ) then
if ( $DoCleanT2 ) then
if ( 0 ) then
if ( $DoCleanFLAIR ) then
if ( 0 ) then



set seedfile = $subjdir/scripts/seed-pons.crs.man.dat
set seedfile = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/seed-pons.crs.man.dat
if ( $#PonsSeedCRS ) then
if ( 0 ) then
if ( -e $seedfile ) set PonsSeedCRS = `cat $seedfile | grep -v \#`
if ( -e /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/seed-pons.crs.man.dat ) set PonsSeedCRS = `cat $seedfile | grep -v \#`
set seedfile = $subjdir/scripts/seed-cc.crs.man.dat
set seedfile = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/seed-cc.crs.man.dat
if ( $#CCSeedCRS ) then
if ( 0 ) then
if ( -e $seedfile ) set CCSeedCRS = `cat $seedfile | grep -v \#`
if ( -e /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/seed-cc.crs.man.dat ) set CCSeedCRS = `cat $seedfile | grep -v \#`
set seedfile = $subjdir/scripts/seed-lh.crs.man.dat
set seedfile = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/seed-lh.crs.man.dat
if ( $#LHSeedCRS ) then
if ( 0 ) then
if ( -e $seedfile ) set LHSeedCRS = `cat $seedfile | grep -v \#`
if ( -e /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/seed-lh.crs.man.dat ) set LHSeedCRS = `cat $seedfile | grep -v \#`
set seedfile = $subjdir/scripts/seed-rh.crs.man.dat
set seedfile = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/seed-rh.crs.man.dat
if ( $#RHSeedCRS ) then
if ( 0 ) then
if ( -e $seedfile ) set RHSeedCRS = `cat $seedfile | grep -v \#`
if ( -e /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/seed-rh.crs.man.dat ) set RHSeedCRS = `cat $seedfile | grep -v \#`

set seedfile = $subjdir/scripts/seed-ws.crs.man.dat
set seedfile = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/seed-ws.crs.man.dat
if ( $#WSSeedPoint ) then
if ( 0 ) then
if ( -e $seedfile ) set WSSeedPoint = `cat $seedfile | grep -v \#`
if ( -e /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/seed-ws.crs.man.dat ) set WSSeedPoint = `cat $seedfile | grep -v \#`


set ControlPointsFile = $subjdir/tmp/control.dat
set ControlPointsFile = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/tmp/control.dat
if ( -e $ControlPointsFile ) then
if ( -e /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/tmp/control.dat ) then


set DefaultTWMControlPointsFile = $subjdir/tmp/twm.dat
set DefaultTWMControlPointsFile = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/tmp/twm.dat
if ( $UseTWMControlPoints ) then
if ( 0 ) then

if ( -e $DefaultTWMControlPointsFile ) then
if ( -e /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/tmp/twm.dat ) then
endif
endif




if ( $DoConformWidth256 ) then
if ( 0 ) then






if ( $DoShowEdits ) then
if ( 0 ) then






if ( $longitudinal && ! $LongSamseg ) then
if ( 0 && ! 0 ) then
if ( $longitudinal && $LongSamseg ) then
if ( 0 && 0 ) then





if ( $#InputList != 0 ) then
if ( 1 != 0 ) then
@ nth = 1 ;
@ nth = 1
foreach InputVol ( $InputList:q )
foreach InputVol ( /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778.nii )
set nthid = `printf %03d.mgz $nth`
set nthid = `printf %03d.mgz $nth`
printf %03d.mgz 1
set cmd = ( mri_convert "$InputVol" $subjdir/mri/orig/$nthid )
set cmd = ( mri_convert /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778.nii /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/mri/orig/001.mgz )
$PWD | & tee -a $LF
/bin/pwd
tee -a /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/recon-all.log
echo "\n $cmd \n" | & tee -a $LF | & tee -a $CF
echo \n mri_convert /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778.nii /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/mri/orig/001.mgz \n
tee -a /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/recon-all.log
tee -a /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/recon-all.cmd
if ( $RunIt ) then
if ( 1 ) then
$fs_time $cmd:q | & tee -a $LF
fs_time mri_convert /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778.nii /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/mri/orig/001.mgz
tee -a /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/recon-all.log
if ( $status ) goto error_exit ;
if ( 0 ) goto error_exit
endif
endif

if ( $nth == 1 ) then
if ( 1 == 1 ) then

set firstInput = $subjdir/mri/orig/$nthid
set firstInput = /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/mri/orig/001.mgz
set rows = `mri_info --nrows $firstInput |& tail -n 1`
set rows = `mri_info --nrows $firstInput |& tail -n 1`
tail -n 1
mri_info --nrows /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/mri/orig/001.mgz
set cols = `mri_info --ncols $firstInput |& tail -n 1`
set cols = `mri_info --ncols $firstInput |& tail -n 1`
tail -n 1
mri_info --ncols /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/mri/orig/001.mgz
set slices = `mri_info --nslices $firstInput |& tail -n 1`
set slices = `mri_info --nslices $firstInput |& tail -n 1`
tail -n 1
mri_info --nslices /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/mri/orig/001.mgz
else
else
@ nth = $nth + 1 ;
@ nth = 1 + 1
end
end
endif
endif





if ( $DoConvertT2Input || $DoConvertFlairInput ) then
if ( 0 || 0 ) then






if ( $#CustomMaskInput ) then
if ( 0 ) then






if ( $DoCreateBaseInput && $DoCreateBaseSubj ) then
if ( 0 && 0 ) then









if ( $DoMotionCor ) then
if ( 0 ) then




if ( $#EMRegMaskArg != 0 ) then
if ( 0 != 0 ) then




if ( $DoDeface ) then
if ( 0 ) then




if ( $DoTalairach ) then
if ( 0 ) then

if ( $DoTalairach ) then
if ( 0 ) then


pushd $SUBJECTS_DIR/$subjid/mri/transforms
pushd /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/mri/transforms
if ( $EMRegStrip == 0 ) then
if ( 1 == 0 ) then
if ( $EMRegAseg == 0 ) then
if ( 1 == 0 ) then
popd
popd


if ( $DoTalCheck ) then
if ( 0 ) then





if ( $DoNuIntensityCor ) then
if ( 0 ) then





if ( $DoNormalization ) then
if ( 0 ) then





if ( $DoSkullStrip ) then
if ( 0 ) then









if ( $DoGCAReg ) then
if ( 0 ) then





if ( $DoCANormalize ) then
if ( 0 ) then





if ( $DoCAReg ) then
if ( 0 ) then





if ( $DoRemoveNeck ) then
if ( 0 ) then





if ( $DoSkullLTA ) then
if ( 0 ) then





if ( $DoCALabel ) then
if ( 0 ) then


Restart:
Restart:

if ( $DoRestart ) then
if ( 0 ) then






if ( $DoCCSeg ) then
if ( 0 ) then






if ( $DoASegMerge ) then
if ( 0 ) then





if ( $DoNormalization2 ) then
if ( 0 ) then





if ( $DoMaskBFS ) then
if ( 0 ) then





if ( $DoSegmentation ) then
if ( 0 ) then




if ( $DoFill ) then
if ( 1 ) then
echo "#--------------------------------------------" | & tee -a $LF | & tee -a $CF
echo #--------------------------------------------
tee -a /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/recon-all.log
tee -a /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/recon-all.cmd
echo "#@# Fill `date`" | & tee -a $SF | & tee -a $LF | & tee -a $CF
echo #@# Fill `date`
tee -a /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/recon-all-status.log
tee -a /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/recon-all.log
tee -a /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/scripts/recon-all.cmd
date
cd $subjdir/mri > /dev/null
cd /home/ydong1/ADNI_100_redo4/ADNI_018_S_0103_MR____________MPRAGE_SENS_br_raw_20060105164049837_85_S10790_I9778/mri
set xopts = `fsr-getxopts mri_fill $XOptsFile $GlobXOptsFile` ;
set xopts = `fsr-getxopts mri_fill $XOptsFile $GlobXOptsFile`
fsr-getxopts mri_fill
set seedopts = ( ) ;
set seedopts = ( )
if ( $#PonsSeedCRS ) set seedopts = ( $seedopts -Pv $PonsSeedCRS ) ;
if ( 0 ) set seedopts = ( -Pv )
if ( $#CCSeedCRS ) set seedopts = ( $seedopts -Cv $CCSeedCRS ) ;
if ( 0 ) set seedopts = ( -Cv )
if ( $#LHSeedCRS ) set seedopts = ( $seedopts -lhv $LHSeedCRS ) ;
if ( 0 ) set seedopts = ( -lhv )
if ( $#RHSeedCRS ) set seedopts = ( $seedopts -rhv $RHSeedCRS ) ;
if ( 0 ) set seedopts = ( -rhv )
set cmd = ( mri_fill -a ../scripts/ponscc.cut.log $seedopts )
set cmd = ( mri_fill -a ../scripts/ponscc.cut.log )
if ( -e transforms/talairach.lta ) then
if ( -e transforms/talairach.lta ) then
if ( $LHonly ) set cmd = ( $cmd -lhonly )
if ( 0 ) set cmd = ( mri_fill -a ../scripts/ponscc.cut.log -lhonly )
if ( $RHonly ) set cmd = ( $cmd -rhonly )
if ( 0 ) set cmd = ( mri_fill -a ../scripts/ponscc.cut.log -rhonly )
if ( $UseAseg ) set cmd = ( $cmd -segmentation aseg.presurf.mgz ) ;
if ( 1 ) set cmd = ( mri_fill -a ../scripts/ponscc.cut.log -segmentation aseg.presurf.mgz )
set cmd = ( mri_fill -a ../scripts/ponscc.cut.log -segmentation aseg.presurf.mgz )
if ( ! $UseOldTopoFix && ! $NoNormMGZ ) set cmd = ( $cmd -topofix norm.mgz ) ;
if ( ! 1 && ! 0 ) set cmd = ( mri_fill -a ../scripts/ponscc.cut.log -segmentation aseg.presurf.mgz -topofix norm.mgz )
set filledman = filled.mgz
set filledman = filled.mgz
set filledauto = filled.auto.mgz
set filledauto = filled.auto.mgz
if ( $FS_ALLOW_FILLED_EDIT ) then
if ( 1 ) then
set cmd = ( $cmd -ctab $FREESURFER/SubCorticalMassLUT.txt )
FREESURFER: Undefined variable.
mv: cannot stat 'recon-all-slurm.%j.%N.out': No such file or directory
mv: cannot stat 'recon-all-slurm.%j.%N.err': No such file or directory
