Skip to content
Merged
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added spm8Batch/Help/PreprocessingDoc.pdf
Binary file not shown.
5 changes: 5 additions & 0 deletions spm8Batch/Help/README
Original file line number Diff line number Diff line change
@@ -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
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
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
3 changes: 1 addition & 2 deletions spm8Batch/spm8Batch_Global
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@ then

curdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
topDIR="$( cd $curdir/.. && pwd )"

# You must point to SPM8 !!!

SPM8B1=${topDIR}/SPM/SPM8/spm8_with_R4667


# This is Robert Welsh's UNIX batch interface to spm8

Expand Down
27 changes: 27 additions & 0 deletions spm8Batch/testIsNumber.sh
Original file line number Diff line number Diff line change
@@ -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

2 changes: 1 addition & 1 deletion spm8Batch/vbm8HiRes
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spm8Batch/warpHiRes
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spm8Batch/warpfMRI
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down