diff --git a/.gitignore b/.gitignore deleted file mode 100644 index a1035399..00000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.local diff --git a/.local/.gitignore b/.local/.gitignore new file mode 100644 index 00000000..8795a9c0 --- /dev/null +++ b/.local/.gitignore @@ -0,0 +1 @@ +CurrentVersionSHA \ No newline at end of file diff --git a/.local/mc_releasetag b/.local/mc_releasetag new file mode 100644 index 00000000..bd5e2d25 --- /dev/null +++ b/.local/mc_releasetag @@ -0,0 +1 @@ +MethodsCore 1.0 \ No newline at end of file diff --git a/README b/README index 50ea40c6..efa8d9b6 100644 --- a/README +++ b/README @@ -1 +1,52 @@ -This is the README for the Methods Core \ No newline at end of file +This directory contains a release of the University of Michigan Psychiatry +Neuroimaging Methods Core tools. The version number of the release can be +found in ./.local/mc_releasetag + +For help with these tools contact us at MethodsCoreHelp@umich.edu + +The goal of the Neuroimaging Methods core is to provide all investigators in +the Department of Psychiatry -- especially junior faculty and young +investigators -- with the latest and best in neuroimaging analysis tools. + +The Core consists of Robert Welsh and Chandra Sripada (Co-directors) as well as +Mike Angstadt, Joseph Heffernan, and Daniel Kessler (Research Area Computer +Specialists). An Executive Committee consisting of five PIs from the +department sets the Core's agenda and oversees activities. They are Jon-Kar +Zubieta, Steve Taylor, Israel Liberzon, Mary Heitzeg, and James Swain. + +The current (tentative) schedule for upcoming releases is as follows: +August 1st Preprocessing, Registration Checks +September 5th First-Level Script +October 3rd Second-Level Script +November 7th Companion Scripts (PPI, Physio Correction, + Motion Regressor Statistics, ROI Scripts, power + analysis, and others) +December 5th Repeated Measures ANOVA + +Our goal is to make sure Methods Core tools are: + *User-friendly including extensive commenting and informative error + messages. + + *Integrated and consistent across tools. + + *Fast using a variety of methods to reduce disk operations and accelerate + performance. + + *Well documented including help files and, in many cases, practical video + documentation. + + *Supported by Methods Core personnel at MethodsCoreHelp@umich.edu + + *Frequently updated to work with current versions of SPM, FSL, MarsBar, etc. + + +Please give us your feedback about how we're doing. + + +Release Notes: + +8/1/2012 - Release 1.0 + First public release of MethodsCore tools. This release contains a + suite of command-line scripts to preprocess fMRI data as well as + perform several basic data quality checks. + diff --git a/SPM/SPM8/spm8Legacy/templates/r2mm_avg152T1_BET.nii b/SPM/SPM8/spm8Legacy/templates/r2mm_avg152T1_BET.nii new file mode 100644 index 00000000..31935e3b Binary files /dev/null and b/SPM/SPM8/spm8Legacy/templates/r2mm_avg152T1_BET.nii differ diff --git a/SPM/SPM8/spm8_with_R4290/templates/r2mm_avg152T1_BET.nii b/SPM/SPM8/spm8_with_R4290/templates/r2mm_avg152T1_BET.nii new file mode 100644 index 00000000..31935e3b Binary files /dev/null and b/SPM/SPM8/spm8_with_R4290/templates/r2mm_avg152T1_BET.nii differ diff --git a/SPM/SPM8/spm8_with_R4667/templates/r2mm_avg152T1_BET.nii b/SPM/SPM8/spm8_with_R4667/templates/r2mm_avg152T1_BET.nii new file mode 100644 index 00000000..31935e3b Binary files /dev/null and b/SPM/SPM8/spm8_with_R4667/templates/r2mm_avg152T1_BET.nii differ diff --git a/spm8Batch/.spm8BatchVersion b/spm8Batch/.spm8BatchVersion index b1024c69..c0975617 100644 --- a/spm8Batch/.spm8BatchVersion +++ b/spm8Batch/.spm8BatchVersion @@ -1 +1 @@ -spm8Batch VBM8 2012-03-13 +spm8Batch MethodsCore Release 1.0 2012-08-01 diff --git a/spm8Batch/Help/PreprocessingDoc.pdf b/spm8Batch/Help/PreprocessingDoc.pdf new file mode 100644 index 00000000..c984ef71 Binary files /dev/null and b/spm8Batch/Help/PreprocessingDoc.pdf differ diff --git a/spm8Batch/Help/README b/spm8Batch/Help/README new file mode 100644 index 00000000..821eb715 --- /dev/null +++ b/spm8Batch/Help/README @@ -0,0 +1,5 @@ +In this folder, you'll find a PDF with a guide on how to use the spm8Batch processing software. + +In addition, you can find a Video Tutorial Walkthrough online at http://youtu.be/zy9ECyw5keA + +More information is available about the MethodsCore Team and support options in the README file at the top level of the Methods Core Directory 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" # 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_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/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/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/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/shellScriptFinalize b/spm8Batch/auxiliary/shellScriptFinalize index 678fcc7c..18c18cc4 100644 --- a/spm8Batch/auxiliary/shellScriptFinalize +++ b/spm8Batch/auxiliary/shellScriptFinalize @@ -33,8 +33,12 @@ echo "# ${execDIR}" echo "#" >> ${FULLSCRIPTNAME}.sh 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 echo "#" >> ${FULLSCRIPTNAME}.sh 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..d5a8d418 100755 --- a/spm8Batch/sliceTime +++ b/spm8Batch/sliceTime @@ -35,7 +35,7 @@ thisDir=`dirname $theCommand` thisCommand=`echo $theCommand | awk -F/ '{print $NF}'` -allowedOptions="ADdfiMntUv#" +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 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..34e2cd50 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. @@ -78,7 +80,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 +102,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} 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