From 9e4025b22df1b27036d9eaf6500458b742961ca1 Mon Sep 17 00:00:00 2001 From: Daniel A Kessler Date: Mon, 16 Jul 2012 14:56:09 -0400 Subject: [PATCH 1/6] Made localization changes to spm8Batch. End users should no longer need to make any localization tweaks aside from manually sourcing spm8Setup or configuring spm8Setup to be automatically sourced for all or some users --- spm8Batch/spm8Batch_Global | 13 ++++++++----- spm8Batch/spm8Setup | 3 ++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/spm8Batch/spm8Batch_Global b/spm8Batch/spm8Batch_Global index 99e1cf0d..3b09415d 100755 --- a/spm8Batch/spm8Batch_Global +++ b/spm8Batch/spm8Batch_Global @@ -38,15 +38,18 @@ then # SOME GLOBAL THINGS TO CHANGE ACCORDING TO SITE # - topDIR=/Users/rcwelsh/Software + + curdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + topDIR="$( cd $curdir/.. && pwd )" # You must point to SPM8 !!! - SPM8B1=${topDIR}/SPM8/spm8_with_R4667 + SPM8B1=${topDIR}/SPM/SPM8/spm8_with_R4667 + # This is Robert Welsh's UNIX batch interface to spm8 - SPM8B2=${topDIR}/spm8Batch/spm8Batch_VBM8 + SPM8B2=${topDIR}/spm8Batch # This must point to the place where the SPM8 patch is locally. @@ -78,7 +81,7 @@ then # Mail job will be sent to your user name at the institutionname # Please set the instituion email server name here. - MAILRECPT=med.umich.edu + MAILRECPT=umich.edu # # Default email address to send messages to, on the linux machines @@ -100,7 +103,7 @@ then # And finally, you need to point to matlab - MATLAB=/Applications/MATLAB_R2011b.app/bin/matlab + MATLAB=`which matlab` # # Only allow author to execute code during switch. diff --git a/spm8Batch/spm8Setup b/spm8Batch/spm8Setup index 34a6b23e..3dcfa109 100755 --- a/spm8Batch/spm8Setup +++ b/spm8Batch/spm8Setup @@ -1,2 +1,3 @@ +curdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -export PATH=/net/dysthymia/spm8Batch:${PATH} +export PATH=${curdir}:${PATH} From 113665b12909f640b55c1edf5fe03288c1579381 Mon Sep 17 00:00:00 2001 From: Daniel A Kessler Date: Mon, 16 Jul 2012 15:02:09 -0400 Subject: [PATCH 2/6] updated documentation in installation readme of spm8Batch to cover new, much more limited installation requirements --- spm8Batch/INSTALL_README.txt | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/spm8Batch/INSTALL_README.txt b/spm8Batch/INSTALL_README.txt index fe02e2f9..edb5f16f 100644 --- a/spm8Batch/INSTALL_README.txt +++ b/spm8Batch/INSTALL_README.txt @@ -1,6 +1,6 @@ # # # # # # # # # # # # # # # # # # # -# This is the spm8Batch processing system written by Robert C. Welsh, Ann Arbor MI +# This is a modified version of the spm8Batch processing system written by Robert C. Welsh, Ann Arbor MI # # Copyright 2002-2012 # @@ -29,29 +29,21 @@ # # INSTALLATION INSTRUCTIONS: # -# Move the spm8Batch tar distribution file to the directory where you wish the code to -# reside. Then untar using -# -# tar -xvf [tarfile] # -# Next you will need to adjust your PATH environmental variable to include +# You will need to adjust your PATH environmental variable to include # the spm8Batch distribution # -# For bash you can add this to your .bashrc or .bash_profile -# -# export PATH=[spm8Batch_distribution_location]:${PATH} -# -# On tcsh you can add this to your .cshrc file. +# You can do this on the fly by running "source spm8Setup" while in this directory. +# You can also edit your .bashrc, .bash_profile, or /etc/bashrc startup scripts to source this automatically +# for all or just some users. # -# setenv PATH [spm8Batch_distribution_location]:${PATH} # -# Next you need to implement the localization changes in spm8Batch_Global that are -# described below. Remember the native language of the spm8Batch system is bash. An +# Remember the native language of the spm8Batch system is bash. An # excellent site for BASH help is: # # http://tldp.org/LDP/abs/html/ # -# You will need to have spm8 distribution +# You will need to have spm8 distribution (Included in this distribution) # # You will need to have fsl, at least 4.1.7, it's known to work with 4.1.7 and 4.1.8 # @@ -73,7 +65,7 @@ # ----------------------------------------------------------------- # ----------------------------------------------------------------- # -# LOCALIZATION +# LOCALIZATION (No longer needs to be edited. This section retained for developer documentation) # # The only file that has to be modified for local distrubution is the scripts "spm8Batch_Global" # From ab9f55b36a5e1889ef89612b35699ac54e1b2f46 Mon Sep 17 00:00:00 2001 From: Daniel A Kessler Date: Mon, 16 Jul 2012 15:25:02 -0400 Subject: [PATCH 3/6] The log files for spm8Batch will now include the SHA of the MethodsCore repository, if available --- spm8Batch/auxiliary/shellScriptFinalize | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spm8Batch/auxiliary/shellScriptFinalize b/spm8Batch/auxiliary/shellScriptFinalize index 678fcc7c..3c44c1ff 100644 --- a/spm8Batch/auxiliary/shellScriptFinalize +++ b/spm8Batch/auxiliary/shellScriptFinalize @@ -33,8 +33,10 @@ echo "# ${execDIR}" echo "#" >> ${FULLSCRIPTNAME}.sh BATCHVERSION=`cat ${thisDir}/.spm8BatchVersion` +[[ -f ${thisDir}/../.local/CurrentVersionSHA ]] && mcSHA=`cat ${thisDir}/../.local/CurrentVersionSHA` echo "# spm8Batch Version : ${BATCHVERSION}" >> ${FULLSCRIPTNAME}.sh +echo "# MethodsCore Repository SHA-ID: $mcSHA" >> ${FULLSCRIPTNAME}.sh echo "#" >> ${FULLSCRIPTNAME}.sh echo "# All done" >> ${FULLSCRIPTNAME}.sh echo "#" >> ${FULLSCRIPTNAME}.sh From 663b66f43f4972f6cd75ec937fcb8e15010bfa00 Mon Sep 17 00:00:00 2001 From: Daniel A Kessler Date: Mon, 16 Jul 2012 15:53:24 -0400 Subject: [PATCH 4/6] log files for spm8Batch will now also include the human readable release tag from .local/mc_releasetag if available --- spm8Batch/auxiliary/shellScriptFinalize | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spm8Batch/auxiliary/shellScriptFinalize b/spm8Batch/auxiliary/shellScriptFinalize index 3c44c1ff..18c18cc4 100644 --- a/spm8Batch/auxiliary/shellScriptFinalize +++ b/spm8Batch/auxiliary/shellScriptFinalize @@ -34,8 +34,10 @@ echo "#" BATCHVERSION=`cat ${thisDir}/.spm8BatchVersion` [[ -f ${thisDir}/../.local/CurrentVersionSHA ]] && mcSHA=`cat ${thisDir}/../.local/CurrentVersionSHA` +[[ -f ${thisDir}/../.local/mc_releasetag ]] && mc_releasetag=`cat ${thisDir}/../.local/mc_releasetag` echo "# spm8Batch Version : ${BATCHVERSION}" >> ${FULLSCRIPTNAME}.sh +echo "# MethodsCore Release Tag : ${mc_releasetag}" >> ${FULLSCRIPTNAME}.sh echo "# MethodsCore Repository SHA-ID: $mcSHA" >> ${FULLSCRIPTNAME}.sh echo "#" >> ${FULLSCRIPTNAME}.sh echo "# All done" >> ${FULLSCRIPTNAME}.sh From b2e1037e9d0aa6540a29d3a8e750f1f081c5f3a6 Mon Sep 17 00:00:00 2001 From: "Robert C. Welsh" Date: Tue, 31 Jul 2012 10:52:20 -0400 Subject: [PATCH 5/6] Corrected 'feature' in warpfMRI about logging, added TR and TGLOBAL options for sliceTime, and finally added the flag '-B' to all commands to allow to run in the foreground to facilitate daisy-chaining of processing. --- spm8Batch/auxiliary/help/help_case_TGLOBAL | 3 +++ .../help/help_case_no_background_job | 2 ++ spm8Batch/auxiliary/help/help_case_warpmethod | 2 ++ spm8Batch/auxiliary/help/help_options_end | 2 ++ spm8Batch/auxiliary/help/help_options_start | 6 +++++ .../auxiliary/help/help_sliceTime_Options | 1 + spm8Batch/auxiliary/initialization_all | 4 +++ spm8Batch/auxiliary/parse_arguments | 16 +++++++++++ spm8Batch/auxiliary/setNoBackgroundJob | 7 +++++ spm8Batch/auxiliary/setTGlobalValue | 20 ++++++++++++++ spm8Batch/auxiliary/shellScriptLaunch | 20 +++++++++++--- spm8Batch/bestBET | 2 +- spm8Batch/coregHiRes | 2 +- spm8Batch/coregOverlay | 2 +- spm8Batch/isnumber.sh | 19 +++++-------- spm8Batch/matlabScripts/UMBatchWarpVBM8.m | 11 ++++++++ spm8Batch/physioCorr | 2 +- spm8Batch/realignfMRI | 2 +- spm8Batch/segHiRes | 2 +- spm8Batch/sliceTime | 2 +- spm8Batch/smoothfMRI | 2 +- spm8Batch/spm8Batch_Global | 10 ++++--- spm8Batch/testIsNumber.sh | 27 +++++++++++++++++++ spm8Batch/vbm8HiRes | 2 +- spm8Batch/warpHiRes | 2 +- spm8Batch/warpfMRI | 2 +- 26 files changed, 140 insertions(+), 32 deletions(-) create mode 100644 spm8Batch/auxiliary/help/help_case_TGLOBAL create mode 100644 spm8Batch/auxiliary/help/help_case_no_background_job create mode 100644 spm8Batch/auxiliary/setNoBackgroundJob create mode 100644 spm8Batch/auxiliary/setTGlobalValue create mode 100755 spm8Batch/testIsNumber.sh diff --git a/spm8Batch/auxiliary/help/help_case_TGLOBAL b/spm8Batch/auxiliary/help/help_case_TGLOBAL new file mode 100644 index 00000000..91312619 --- /dev/null +++ b/spm8Batch/auxiliary/help/help_case_TGLOBAL @@ -0,0 +1,3 @@ + echo " -G TGLOBAL change the TGLOBAL parameters for fsl/slicetimer, " + echo " default is 0.50" + echo diff --git a/spm8Batch/auxiliary/help/help_case_no_background_job b/spm8Batch/auxiliary/help/help_case_no_background_job new file mode 100644 index 00000000..5efb2dc6 --- /dev/null +++ b/spm8Batch/auxiliary/help/help_case_no_background_job @@ -0,0 +1,2 @@ + echo " -B run in the foreground, need for daisy chaining jobs." + echo diff --git a/spm8Batch/auxiliary/help/help_case_warpmethod b/spm8Batch/auxiliary/help/help_case_warpmethod index 29c1a021..903ef0e7 100644 --- a/spm8Batch/auxiliary/help/help_case_warpmethod +++ b/spm8Batch/auxiliary/help/help_case_warpmethod @@ -1,3 +1,5 @@ echo " -W Enable VBM8 warping for fMRI, you need to run vbm8HiRes first." echo " Default is to use standard SPM8 normalization." + echo " This will set the output name to 'vbm8_', so use '-w' after" + echo " you specificy '-W' if you wish to use 'w' as the prepend name." echo diff --git a/spm8Batch/auxiliary/help/help_options_end b/spm8Batch/auxiliary/help/help_options_end index e3863a9a..802442f9 100644 --- a/spm8Batch/auxiliary/help/help_options_end +++ b/spm8Batch/auxiliary/help/help_options_end @@ -2,6 +2,8 @@ echo "${helpComment} functional images path : $fmriPATH" echo "${helpComment} Subject directory : ${SUBJDIR}" echo + echo "${helpComment} Back(1)/fore(0)ground : ${BACKGROUNDJOBFLAG}" + echo echo "${helpComment} spm8 is located in : $SPM8B1" echo "${helpComment} spm8Batch is located in : $SPM8B2" echo "${helpComment} spm8 patch is located in : $SPM8B3" diff --git a/spm8Batch/auxiliary/help/help_options_start b/spm8Batch/auxiliary/help/help_options_start index 0134987b..bcf82dd2 100644 --- a/spm8Batch/auxiliary/help/help_options_start +++ b/spm8Batch/auxiliary/help/help_options_start @@ -54,6 +54,9 @@ "a") . ${thisDir}/auxiliary/help/help_case_anatomy_path ;; + "B") + . ${thisDir}/auxiliary/help/help_case_no_background_job + ;; "b") . ${thisDir}/auxiliary/help/help_case_bet_best_flag ;; @@ -69,6 +72,9 @@ "f") . ${thisDir}/auxiliary/help/help_case_functional_path ;; + "G") + . ${thisDir}/auxiliary/help/help_case_TGLOBAL + ;; "g") . ${thisDir}/auxiliary/help/help_case_BET_gradient ;; diff --git a/spm8Batch/auxiliary/help/help_sliceTime_Options b/spm8Batch/auxiliary/help/help_sliceTime_Options index 47392a0b..db9e92ff 100644 --- a/spm8Batch/auxiliary/help/help_sliceTime_Options +++ b/spm8Batch/auxiliary/help/help_sliceTime_Options @@ -1,6 +1,7 @@ echo "${helpComment} Sub-directory : ${subPATH}" echo "${helpComment} Volume Wildcard : ${volumeWILD}" echo "${helpComment} fMRI TR : ${TR}" + echo "${helpComment} TGLOBAL : ${TGLOBAL}" echo "${helpComment} FSLOUTPUTTYPE : ${FSLOUTPUTTYPE}" echo "${helpComment} Number of runs to realign : ${nRUN}" diff --git a/spm8Batch/auxiliary/initialization_all b/spm8Batch/auxiliary/initialization_all index 810a7126..7fb55a57 100644 --- a/spm8Batch/auxiliary/initialization_all +++ b/spm8Batch/auxiliary/initialization_all @@ -92,6 +92,10 @@ SLICETIMEROPT= BATCHCOMMAND=1 +# Is this command to run in the background + +BACKGROUNDJOBFLAG=1 + # # Now the process specific initialization # diff --git a/spm8Batch/auxiliary/parse_arguments b/spm8Batch/auxiliary/parse_arguments index 401be941..e8e1b000 100644 --- a/spm8Batch/auxiliary/parse_arguments +++ b/spm8Batch/auxiliary/parse_arguments @@ -67,6 +67,15 @@ do . ${thisDir}/auxiliary/setAnatomyPath ;; + # case_no_background_job + # + # don't launch the job into the background, but run in the foreground, + # this will facilitate daisy-chaining jobs. + # + "B") + . ${thisDir}/auxiliary/setNoBackgroundJob + ;; + # case_bet_best_flag # # look at the BET best flag @@ -107,6 +116,13 @@ do . ${thisDir}/auxiliary/setFunctionalPath ;; + # case_set_TGLOBAL + # + # Set the TGLOBAL value for slice time + # + "G") + . ${thisDir}/auxiliary/setTGlobalValue + ;; # case_set_BET_gradient # # Set the gradient scale for bestBET diff --git a/spm8Batch/auxiliary/setNoBackgroundJob b/spm8Batch/auxiliary/setNoBackgroundJob new file mode 100644 index 00000000..c81eec23 --- /dev/null +++ b/spm8Batch/auxiliary/setNoBackgroundJob @@ -0,0 +1,7 @@ + +# The user wants to run the job in the foreground, only recommended for daisy-chaining. +# We also set the mail account to be null that way jobs in foreground do not by default send +# out email. However, this can be overridden with the -U flag. + + BACKGROUNDJOBFLAG=0 + USEREMAIL="NOMAIL" diff --git a/spm8Batch/auxiliary/setTGlobalValue b/spm8Batch/auxiliary/setTGlobalValue new file mode 100644 index 00000000..bf4a2adc --- /dev/null +++ b/spm8Batch/auxiliary/setTGlobalValue @@ -0,0 +1,20 @@ +# +# Set the value of TGLOBAL +# + shift + let argn++ + if (( $argn >= $args )) + then + echo "Missing parameter for setting TGLOBAL" + . ${thisDir}/auxiliary/exit_w_removal + else + isnumber $1 + retVal=$? + if [ "$retVal" != "0" ] + then + echo "TGLOBAL needs to be numeric, you entered : $1" + . ${thisDir}/auxiliary/exit_w_removal + fi + TGLOBAL=`echo $1 | awk '{printf "%2.2f",$1}'` + isnumber $TGLOBAL + fi diff --git a/spm8Batch/auxiliary/shellScriptLaunch b/spm8Batch/auxiliary/shellScriptLaunch index 97dd2640..f9182ff2 100755 --- a/spm8Batch/auxiliary/shellScriptLaunch +++ b/spm8Batch/auxiliary/shellScriptLaunch @@ -11,10 +11,22 @@ echo "${FULLSCRIPTNAME}.sh" > ${thisDir}/Usage/${SANDBOXHOST}/${theYearMonth}/${ if [ ! "$debugFLAG" == "1" ] then - echo - echo " Lauching script into background." - echo - nohup ${FULLSCRIPTNAME}.sh &> ${FULLSCRIPTNAME}.log & + if [ "${BACKGROUNDJOBFLAG}" == "1" ] + then + echo + echo " Lauching script into background." + echo + nohup ${FULLSCRIPTNAME}.sh &> ${FULLSCRIPTNAME}.log & + else + echo + echo " Launching script into foreground." + echo + ${FULLSCRIPTNAME}.sh &> ${FULLSCRIPTNAME}.log + echo + echo " Script ${FULLSCRIPTNAME}.sh is finished" + echo " Script LOGFILE is : ${FULLSCRIPTNAME}.log" + echo + fi else echo echo " Script can now be launched by hand." diff --git a/spm8Batch/bestBET b/spm8Batch/bestBET index 40d6492d..e8714236 100755 --- a/spm8Batch/bestBET +++ b/spm8Batch/bestBET @@ -35,7 +35,7 @@ thisDir=`dirname $theCommand` thisCommand=`echo $theCommand | awk -F/ '{print $NF}'` #allowedOptions="aDdfhMnOoRrtUw" -allowedOptions="aDdghMtU" +allowedOptions="aBDdghMtU" # This piece of code all of the spm8Batch scripts will use . ${thisDir}/auxiliary/commonCode_AllScriptsStart diff --git a/spm8Batch/coregHiRes b/spm8Batch/coregHiRes index c066abb5..ff9d2ab7 100755 --- a/spm8Batch/coregHiRes +++ b/spm8Batch/coregHiRes @@ -40,7 +40,7 @@ thisDir=`dirname $theCommand` thisCommand=`echo $theCommand | awk -F/ '{print $NF}'` #allowedOptions="aDdfhMnOoRrtUw" - reslice only is NOT working with other images. -allowedOptions="aDdfhMnOorrtUw" +allowedOptions="aBDdfhMnOorrtUw" # This piece of code all of the spm8Batch scripts will use . ${thisDir}/auxiliary/commonCode_AllScriptsStart diff --git a/spm8Batch/coregOverlay b/spm8Batch/coregOverlay index 42d3879c..8b3046b6 100755 --- a/spm8Batch/coregOverlay +++ b/spm8Batch/coregOverlay @@ -43,7 +43,7 @@ thisDir=`dirname $theCommand` thisCommand=`echo $theCommand | awk -F/ '{print $NF}'` #allowedOptions="aDdfMnOoRrstUvw" -allowedOptions="aDdfMnOorstUvw" +allowedOptions="aBDdfMnOorstUvw" # This piece of code all of the spm8Batch scripts will use . ${thisDir}/auxiliary/commonCode_AllScriptsStart diff --git a/spm8Batch/isnumber.sh b/spm8Batch/isnumber.sh index 534b6a30..8ca4919e 100755 --- a/spm8Batch/isnumber.sh +++ b/spm8Batch/isnumber.sh @@ -27,22 +27,15 @@ isdigit() fi } +# New code for determining is an input is a number - 2012-07-27 - RCWelsh + isnumber () # Test if the parameter is a number (integer or float) { retVal=1; - nPeriod=`echo $1 | awk -F . '{print NF}'` - if [ "$nPeriod" -ne "1" -a "$nPeriod" -ne "2" ] - then - return $FAILURE - fi - theNumber=`echo $1 | sed 's/\.//g' ` - isdigit $theNumber + # do it by trying to printf the number fo get error if bad + printf "%2.2f" $1 2> /dev/null > /dev/null retVal=$? - if [ "$retVal" == "0" ] - then - return $SUCCESS - else - return $FAILURE - fi + return $retVal } + diff --git a/spm8Batch/matlabScripts/UMBatchWarpVBM8.m b/spm8Batch/matlabScripts/UMBatchWarpVBM8.m index 1a319a86..1fe1a6ff 100644 --- a/spm8Batch/matlabScripts/UMBatchWarpVBM8.m +++ b/spm8Batch/matlabScripts/UMBatchWarpVBM8.m @@ -219,6 +219,10 @@ [Images2WriteUnique Images2WriteCount] = uniqueNII(Images2Write); + % If the prefix is "w" then we just need to report the images that + % vbm8 has already generated. - RCWelsh 2012-07-27 + tmpNewImages2WriteUnique = []; + for iNII = 1:size(Images2WriteUnique,1) [d1 d2 d3 d4] = spm_fileparts(strtrim(Images2WriteUnique(iNII,:))); newFile = fullfile(d1,['w' d2 d3]); @@ -229,6 +233,9 @@ fprintf('\n\n* * * * * * * * * * * * \n\n'); return end + % If the prefix is "w" then we just need to report the images that + % vbm8 has already generated. - RCWelsh 2012-07-27 + tmpNewImages2WriteUnique = strvcat(tmpNewImages2WriteUnique, newFile); end % Everything up to this point is okay @@ -253,6 +260,10 @@ end newImages2WriteUnique = strvcat(newImages2WriteUnique, newFile); end + else + % If the prefix is "w" then we just need to report the images that + % vbm8 has already generated. - RCWelsh 2012-07-27 + newImages2WriteUnique = tmpNewImages2WriteUnique; end ImageDirectory = fileparts(Images2Write(1,:)); diff --git a/spm8Batch/physioCorr b/spm8Batch/physioCorr index 9ae762ee..0f32f034 100755 --- a/spm8Batch/physioCorr +++ b/spm8Batch/physioCorr @@ -38,7 +38,7 @@ thisDir=`dirname $theCommand` thisCommand=`echo $theCommand | awk -F/ '{print $NF}'` -allowedOptions="ADdfFiMnpPtUv#" +allowedOptions="ABDdfFiMnpPtUv#" # This piece of code all of the spm8Batch scripts will use . ${thisDir}/auxiliary/commonCode_AllScriptsStart diff --git a/spm8Batch/realignfMRI b/spm8Batch/realignfMRI index f4b9cd7a..20ad7f15 100755 --- a/spm8Batch/realignfMRI +++ b/spm8Batch/realignfMRI @@ -32,7 +32,7 @@ thisDir=`dirname $theCommand` thisCommand=`echo $theCommand | awk -F/ '{print $NF}'` -allowedOptions="ADdfiMmnStUv#" +allowedOptions="BADdfiMmnStUv#" # This piece of code all of the spm8Batch scripts will use . ${thisDir}/auxiliary/commonCode_AllScriptsStart diff --git a/spm8Batch/segHiRes b/spm8Batch/segHiRes index 3ad78d60..85a8ad3e 100755 --- a/spm8Batch/segHiRes +++ b/spm8Batch/segHiRes @@ -38,7 +38,7 @@ thisDir=`dirname $theCommand` thisCommand=`echo $theCommand | awk -F/ '{print $NF}'` #allowedOptions="DdfhMnTtUw" -allowedOptions="DdfhMTtUw" +allowedOptions="BDdfhMTtUw" # This piece of code all of the spm8Batch scripts will use . ${thisDir}/auxiliary/commonCode_AllScriptsStart diff --git a/spm8Batch/sliceTime b/spm8Batch/sliceTime index 410fd3cd..0354e00c 100755 --- a/spm8Batch/sliceTime +++ b/spm8Batch/sliceTime @@ -35,7 +35,7 @@ thisDir=`dirname $theCommand` thisCommand=`echo $theCommand | awk -F/ '{print $NF}'` -allowedOptions="ADdfiMntUv#" +allowedOptions="ABDdFfGiMntUv#" # This piece of code all of the spm8Batch scripts will use . ${thisDir}/auxiliary/commonCode_AllScriptsStart diff --git a/spm8Batch/smoothfMRI b/spm8Batch/smoothfMRI index 48423ae9..fd0189ed 100755 --- a/spm8Batch/smoothfMRI +++ b/spm8Batch/smoothfMRI @@ -32,7 +32,7 @@ thisDir=`dirname $theCommand` thisCommand=`echo $theCommand | awk -F/ '{print $NF}'` -allowedOptions="DdfMntUv" +allowedOptions="BDdfMntUv" # This piece of code all of the spm8Batch scripts will use . ${thisDir}/auxiliary/commonCode_AllScriptsStart diff --git a/spm8Batch/spm8Batch_Global b/spm8Batch/spm8Batch_Global index 99e1cf0d..9ada89a4 100755 --- a/spm8Batch/spm8Batch_Global +++ b/spm8Batch/spm8Batch_Global @@ -38,15 +38,17 @@ then # SOME GLOBAL THINGS TO CHANGE ACCORDING TO SITE # - topDIR=/Users/rcwelsh/Software - + + curdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + topDIR="$( cd $curdir/.. && pwd )" + # You must point to SPM8 !!! - SPM8B1=${topDIR}/SPM8/spm8_with_R4667 + SPM8B1=${topDIR}/SPM/SPM8/spm8_with_R4667 # This is Robert Welsh's UNIX batch interface to spm8 - SPM8B2=${topDIR}/spm8Batch/spm8Batch_VBM8 + SPM8B2=${topDIR}/spm8Batch # This must point to the place where the SPM8 patch is locally. diff --git a/spm8Batch/testIsNumber.sh b/spm8Batch/testIsNumber.sh new file mode 100755 index 00000000..bfa9628e --- /dev/null +++ b/spm8Batch/testIsNumber.sh @@ -0,0 +1,27 @@ + +. isnumber.sh + +for THING in a 1 a1 1.1 1.1.1 0.1 +do + isnumber $THING + retVal=$? + if [ "$retVal" == "0" ] + then + echo $retVal NUMBER $THING + else + echo $retVal NOTNUMBER $THING + fi +done + +for THING in a b c 1 2 3 4 . +do + isdigit $THING + retVal=$? + if [ "$retVal" == "0" ] + then + echo $retVal DIGIT $THING + else + echo $retVal NOTDIGIT $THING + fi +done + \ No newline at end of file diff --git a/spm8Batch/vbm8HiRes b/spm8Batch/vbm8HiRes index c70f43c8..465898fd 100755 --- a/spm8Batch/vbm8HiRes +++ b/spm8Batch/vbm8HiRes @@ -37,7 +37,7 @@ thisDir=`dirname $theCommand` thisCommand=`echo $theCommand | awk -F/ '{print $NF}'` -allowedOptions="aDdhIMnOtUwz" +allowedOptions="aBDdhIMnOtUwz" # This piece of code all of the spm8Batch scripts will use . ${thisDir}/auxiliary/commonCode_AllScriptsStart diff --git a/spm8Batch/warpHiRes b/spm8Batch/warpHiRes index 8c690c22..640b897f 100755 --- a/spm8Batch/warpHiRes +++ b/spm8Batch/warpHiRes @@ -37,7 +37,7 @@ thisDir=`dirname $theCommand` thisCommand=`echo $theCommand | awk -F/ '{print $NF}'` -allowedOptions="DdfhMnOTtUwz" +allowedOptions="BDdfhMnOTtUwz" # This piece of code all of the spm8Batch scripts will use . ${thisDir}/auxiliary/commonCode_AllScriptsStart diff --git a/spm8Batch/warpfMRI b/spm8Batch/warpfMRI index 044947d5..b2e2b57a 100755 --- a/spm8Batch/warpfMRI +++ b/spm8Batch/warpfMRI @@ -37,7 +37,7 @@ thisDir=`dirname $theCommand` thisCommand=`echo $theCommand | awk -F/ '{print $NF}'` -allowedOptions="DdfhIMntUvWwz" +allowedOptions="BDdfhIMntUvWwz" # This piece of code all of the spm8Batch scripts will use . ${thisDir}/auxiliary/commonCode_AllScriptsStart From 2de66105887857ff805457d51715889721ce718b Mon Sep 17 00:00:00 2001 From: "Robert C. Welsh" Date: Tue, 31 Jul 2012 12:22:07 -0400 Subject: [PATCH 6/6] Added the '-m' option to sliceTime to allow for adding command line options to slicetimer via sliceTime --- spm8Batch/auxiliary/help/help_case_flirt_options | 6 ++++-- spm8Batch/auxiliary/initialization_sliceTime | 2 ++ spm8Batch/sliceTime | 8 ++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/spm8Batch/auxiliary/help/help_case_flirt_options b/spm8Batch/auxiliary/help/help_case_flirt_options index 7ac37e43..171ea94f 100644 --- a/spm8Batch/auxiliary/help/help_case_flirt_options +++ b/spm8Batch/auxiliary/help/help_case_flirt_options @@ -1,5 +1,7 @@ - echo " -m \"flirt options\" enable super debug flag." + echo " -m \"fsl options\" Give options to mcflirt or slicetimer." echo " Be sure to specify inside of quotes." echo " do \"mcflirt --help\" for help." - echo " default is \"-cost normcorr -stats -plots\"" + echo " do \"slicetimer --help\" for help." + echo " default for mcflirt is \"-cost normcorr -stats -plots\"" + echo " default for slicetimer is \"\"" echo diff --git a/spm8Batch/auxiliary/initialization_sliceTime b/spm8Batch/auxiliary/initialization_sliceTime index f4c790f5..5c2ae150 100644 --- a/spm8Batch/auxiliary/initialization_sliceTime +++ b/spm8Batch/auxiliary/initialization_sliceTime @@ -9,6 +9,8 @@ FSL_COMMENT_B="Slice time correcting subject" outputName=a +mcOPT="" + # # all done # diff --git a/spm8Batch/sliceTime b/spm8Batch/sliceTime index 0354e00c..d5a8d418 100755 --- a/spm8Batch/sliceTime +++ b/spm8Batch/sliceTime @@ -35,7 +35,7 @@ thisDir=`dirname $theCommand` thisCommand=`echo $theCommand | awk -F/ '{print $NF}'` -allowedOptions="ABDdFfGiMntUv#" +allowedOptions="ABDdFfGiMmntUv#" # This piece of code all of the spm8Batch scripts will use . ${thisDir}/auxiliary/commonCode_AllScriptsStart @@ -141,15 +141,15 @@ echo " CURRUN4D=\`ls ${volumeWILD}*.nii 2> /dev/null\` " echo " if [ -e \"\${CURRUN4D}\" ] " >> ${FULLSCRIPTNAME}.sh echo " then" >> ${FULLSCRIPTNAME}.sh echo " FSLOUTPUTTYPE=NIFTI" >> ${FULLSCRIPTNAME}.sh -echo " echo \"slicetimer -i \${CURRUN4D} -o ${outputName}\${CURRUN4D} -r ${TR} --tglobal=${TGLOBAL}\"">> ${FULLSCRIPTNAME}.sh -echo " slicetimer -i \${CURRUN4D} -o ${outputName}\${CURRUN4D} -r ${TR} --tglobal=${TGLOBAL}" >> ${FULLSCRIPTNAME}.sh +echo " echo \"slicetimer -i \${CURRUN4D} -o ${outputName}\${CURRUN4D} ${mcOPT} -r ${TR} --tglobal=${TGLOBAL}\"">> ${FULLSCRIPTNAME}.sh +echo " slicetimer -i \${CURRUN4D} -o ${outputName}\${CURRUN4D} ${mcOPT} -r ${TR} --tglobal=${TGLOBAL}" >> ${FULLSCRIPTNAME}.sh echo " logTheUMProcess sliceTime ${FULLSCRIPTNAME} \${CURRUN4D} ${outputName}\${CURRUN4D}" >> ${FULLSCRIPTNAME}.sh echo " else" >> ${FULLSCRIPTNAME}.sh echo " echo \"Can't find a 4D ${volumeWILD}*.nii for this run \${CURRUN}\" " >> ${FULLSCRIPTNAME}.sh echo " fi" >> ${FULLSCRIPTNAME}.sh echo " else" >> ${FULLSCRIPTNAME}.sh echo " echo \"Test mode.\" " >> ${FULLSCRIPTNAME}.sh -echo " echo \"slicetimer -i \${CURRUN4D} -o ${outputName}\${CURRUN4D} -r ${TR} --tglobal=${TGLOBAL}\" " >> ${FULLSCRIPTNAME}.sh +echo " echo \"slicetimer -i \${CURRUN4D} -o ${outputName}\${CURRUN4D} ${mcOPT} -r ${TR} --tglobal=${TGLOBAL}\" " >> ${FULLSCRIPTNAME}.sh echo " fi" >> ${FULLSCRIPTNAME}.sh echo " cd ../" >> ${FULLSCRIPTNAME}.sh echo " done" >> ${FULLSCRIPTNAME}.sh