Revision 0b6c6e876b7ba111f3ba374d1b3843ff6cf3bbbb authored by Timothy Brown on 05 March 2014, 18:46:48 UTC, committed by Timothy Brown on 05 March 2014, 18:46:48 UTC
Assumes that the GPU-enabled version of eddy will be named eddy.gpu. Falls back to use the standard version of eddy if eddy.gpu is either not found or returns a failure code.
1 parent dcf07aa
TaskfMRIAnalysis.sh
#!/bin/bash
set -e
# Requirements for this script
# installed versions of: FSL5.0.2 or higher , FreeSurfer (version 5 or higher) , gradunwarp (python code from MGH)
# environment: use SetUpHCPPipeline.sh (or individually set FSLDIR, FREESURFER_HOME, HCPPIPEDIR, PATH - for gradient_unwarp.py)
########################################## PIPELINE OVERVIEW ##########################################
# TODO
########################################## OUTPUT DIRECTORIES ##########################################
# TODO
# --------------------------------------------------------------------------------
# Load Function Libraries
# --------------------------------------------------------------------------------
source $HCPPIPEDIR/global/scripts/log.shlib # Logging related functions
source $HCPPIPEDIR/global/scripts/opts.shlib # Command line option functions
################################################ SUPPORT FUNCTIONS ##################################################
# --------------------------------------------------------------------------------
# Usage Description Function
# --------------------------------------------------------------------------------
show_usage() {
echo "Usage information To Be Written"
exit 1
}
# --------------------------------------------------------------------------------
# Establish tool name for logging
# --------------------------------------------------------------------------------
log_SetToolName "TaskfMRIAnalysis.sh"
################################################## OPTION PARSING #####################################################
opts_ShowVersionIfRequested $@
if opts_CheckForHelpRequest $@; then
show_usage
fi
log_Msg "Parsing Command Line Options"
# parse arguments
Path=`opts_GetOpt1 "--path" $@` # "$1"
Subject=`opts_GetOpt1 "--subject" $@` # "$2"
LevelOnefMRINames=`opts_GetOpt1 "--lvl1tasks" $@`
LevelOnefsfNames=`opts_GetOpt1 "--lvl1fsfs" $@`
LevelTwofMRIName=`opts_GetOpt1 "--lvl2task" $@`
LevelTwofsfNames=`opts_GetOpt1 "--lvl2fsf" $@`
LowResMesh=`opts_GetOpt1 "--lowresmesh" $@` # "$6"
GrayordinatesResolution=`opts_GetOpt1 "--grayordinatesres" $@` # "${14}"
OriginalSmoothingFWHM=`opts_GetOpt1 "--origsmoothingFWHM" $@` # "${14}"
Confound=`opts_GetOpt1 "--confound" $@`
FinalSmoothingFWHM=`opts_GetOpt1 "--finalsmoothingFWHM" $@`
TemporalFilter=`opts_GetOpt1 "--temporalfilter" $@`
VolumeBasedProcessing=`opts_GetOpt1 "--vba" $@`
# Setup PATHS
PipelineScripts=${HCPPIPEDIR_tfMRIAnalysis}
LevelOnefMRINames=`echo $LevelOnefMRINames | sed 's/@/ /g'`
LevelOnefsfNames=`echo $LevelOnefsfNames | sed 's/@/ /g'`
#Naming Conventions
AtlasFolder="${Path}/${Subject}/MNINonLinear"
ResultsFolder="${AtlasFolder}/Results"
ROIsFolder="${AtlasFolder}/ROIs"
DownSampleFolder="${AtlasFolder}/fsaverage_LR${LowResMesh}k"
#Run Level One Analysis for Both Phase Encoding Directions
log_Msg "Run Level One Analysis for Both Phase Encoding Directions"
i=1
for LevelOnefMRIName in $LevelOnefMRINames ; do
LevelOnefsfName=`echo $LevelOnefsfNames | cut -d " " -f $i`
${PipelineScripts}/TaskfMRILevel1.sh $Subject $ResultsFolder $ROIsFolder $DownSampleFolder $LevelOnefMRIName $LevelOnefsfName $LowResMesh $GrayordinatesResolution $OriginalSmoothingFWHM $Confound $FinalSmoothingFWHM $TemporalFilter $VolumeBasedProcessing
echo "set -- $Subject $ResultsFolder $ROIsFolder $DownSampleFolder $LevelOnefMRIName $LevelOnefsfName $LowResMesh $GrayordinatesResolution $OriginalSmoothingFWHM $Confound $FinalSmoothingFWHM $TemporalFilter $VolumeBasedProcessing"
i=$(($i+1))
done
LevelOnefMRINames=`echo $LevelOnefMRINames | sed 's/ /@/g'`
LevelOnefsfNames=`echo $LevelOnefMRINames | sed 's/ /@/g'`
#Combine Data Across Phase Encoding Directions in the Level Two Analysis
log_Msg "Combine Data Across Phase Encoding Directions in the Level Two Analysis"
${PipelineScripts}/TaskfMRILevel2.sh $Subject $ResultsFolder $DownSampleFolder $LevelOnefMRINames $LevelOnefsfNames $LevelTwofMRIName $LevelTwofsfNames $LowResMesh $FinalSmoothingFWHM $TemporalFilter $VolumeBasedProcessing
echo "set -- $Subject $ResultsFolder $DownSampleFolder $LevelOnefMRINames $LevelOnefsfNames $LevelTwofMRIName $LevelTwofsfNames $LowResMesh $FinalSmoothingFWHM $TemporalFilter $VolumeBasedProcessing"
log_Msg "Completed"
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...