Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 8 additions & 16 deletions spm8Batch/INSTALL_README.txt
Original file line number Diff line number Diff line change
@@ -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
#
Expand Down Expand Up @@ -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
#
Expand All @@ -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"
#
Expand Down
3 changes: 3 additions & 0 deletions spm8Batch/auxiliary/help/help_case_TGLOBAL
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
echo " -G TGLOBAL change the TGLOBAL parameters for fsl/slicetimer, "
echo " default is 0.50"
echo
6 changes: 4 additions & 2 deletions spm8Batch/auxiliary/help/help_case_flirt_options
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions spm8Batch/auxiliary/help/help_case_no_background_job
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
echo " -B run in the foreground, need for daisy chaining jobs."
echo
2 changes: 2 additions & 0 deletions spm8Batch/auxiliary/help/help_case_warpmethod
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions spm8Batch/auxiliary/help/help_options_end
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions spm8Batch/auxiliary/help/help_options_start
Original file line number Diff line number Diff line change
Expand Up @@ -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
;;
Expand All @@ -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
;;
Expand Down
1 change: 1 addition & 0 deletions spm8Batch/auxiliary/help/help_sliceTime_Options
Original file line number Diff line number Diff line change
@@ -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}"

Expand Down
4 changes: 4 additions & 0 deletions spm8Batch/auxiliary/initialization_all
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ SLICETIMEROPT=

BATCHCOMMAND=1

# Is this command to run in the background

BACKGROUNDJOBFLAG=1

#
# Now the process specific initialization
#
Expand Down
2 changes: 2 additions & 0 deletions spm8Batch/auxiliary/initialization_sliceTime
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ FSL_COMMENT_B="Slice time correcting subject"

outputName=a

mcOPT=""

#
# all done
#
16 changes: 16 additions & 0 deletions spm8Batch/auxiliary/parse_arguments
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions spm8Batch/auxiliary/setNoBackgroundJob
Original file line number Diff line number Diff line change
@@ -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"
20 changes: 20 additions & 0 deletions spm8Batch/auxiliary/setTGlobalValue
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions spm8Batch/auxiliary/shellScriptFinalize
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 16 additions & 4 deletions spm8Batch/auxiliary/shellScriptLaunch
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
2 changes: 1 addition & 1 deletion spm8Batch/bestBET
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spm8Batch/coregHiRes
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spm8Batch/coregOverlay
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 6 additions & 13 deletions spm8Batch/isnumber.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}


11 changes: 11 additions & 0 deletions spm8Batch/matlabScripts/UMBatchWarpVBM8.m
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand All @@ -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
Expand All @@ -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,:));
Expand Down
2 changes: 1 addition & 1 deletion spm8Batch/physioCorr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spm8Batch/realignfMRI
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spm8Batch/segHiRes
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions spm8Batch/sliceTime
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spm8Batch/smoothfMRI
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading