https://github.com/lennartverhagen/Pipelines
Tip revision: a1a15a93a6a7acce067d6ec207d951a4934b1193 authored by Timothy Brown on 14 January 2014, 20:18:18 UTC
Created Version v3.0RC3
Created Version v3.0RC3
Tip revision: a1a15a9
GenericfMRISurfaceProcessingPipeline.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 "GenericfMRISurfaceProcessingPipeline.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"
NameOffMRI=`opts_GetOpt1 "--fmriname" $@` # "$6"
LowResMesh=`opts_GetOpt1 "--lowresmesh" $@` # "$6"
FinalfMRIResolution=`opts_GetOpt1 "--fmrires" $@` # "${14}"
SmoothingFWHM=`opts_GetOpt1 "--smoothingFWHM" $@` # "${14}"
GrayordinatesResolution=`opts_GetOpt1 "--grayordinatesres" $@` # "${14}"
RUN=`opts_GetOpt1 "--printcom" $@` # use ="echo" for just printing everything and not running the commands (default is to run)
# Setup PATHS
PipelineScripts=${HCPPIPEDIR_fMRISurf}
GlobalScripts=${HCPPIPEDIR_Global}
GlobalBinaries=${HCPPIPEDIR_Bin}
#Naming Conventions
AtlasSpaceFolder="MNINonLinear"
T1wFolder="T1w"
NativeFolder="Native"
ResultsFolder="Results"
DownSampleFolder="fsaverage_LR${LowResMesh}k"
ROIFolder="ROIs"
OutputAtlasDenseTimeseries="${NameOffMRI}_Atlas"
AtlasSpaceFolder="$Path"/"$Subject"/"$AtlasSpaceFolder"
T1wFolder="$Path"/"$Subject"/"$T1wFolder"
ResultsFolder="$AtlasSpaceFolder"/"$ResultsFolder"/"$NameOffMRI"
ROIFolder="$AtlasSpaceFolder"/"$ROIFolder"
#Make fMRI Ribbon
#Noisy Voxel Outlier Exclusion
#Ribbon-based Volume to Surface mapping and resampling to standard surface
log_Msg "Make fMRI Ribbon"
log_Msg "mkdir -p ${ResultsFolder}/RibbonVolumeToSurfaceMapping"
mkdir -p "$ResultsFolder"/RibbonVolumeToSurfaceMapping
"$PipelineScripts"/RibbonVolumeToSurfaceMapping.sh "$ResultsFolder"/RibbonVolumeToSurfaceMapping "$ResultsFolder"/"$NameOffMRI" "$Subject" "$AtlasSpaceFolder"/"$DownSampleFolder" "$LowResMesh" "$AtlasSpaceFolder"/"$NativeFolder" "$T1wFolder"/"$NativeFolder"
#Surface Smoothing
log_Msg "Surface Smoothing"
"$PipelineScripts"/SurfaceSmoothing.sh "$ResultsFolder"/"$NameOffMRI" "$Subject" "$AtlasSpaceFolder"/"$DownSampleFolder" "$LowResMesh" "$SmoothingFWHM"
#Subcortical Processing
log_Msg "Subcortical Processing"
"$PipelineScripts"/SubcorticalProcessing.sh "$AtlasSpaceFolder" "$ROIFolder" "$FinalfMRIResolution" "$ResultsFolder" "$NameOffMRI" "$SmoothingFWHM" "$GrayordinatesResolution"
#Generation of Dense Timeseries
log_Msg "Generation of Dense Timeseries"
"$PipelineScripts"/CreateDenseTimeseries.sh "$AtlasSpaceFolder"/"$DownSampleFolder" "$Subject" "$LowResMesh" "$ResultsFolder"/"$NameOffMRI" "$SmoothingFWHM" "$ROIFolder" "$ResultsFolder"/"$OutputAtlasDenseTimeseries" "$GrayordinatesResolution"
log_Msg "Completed"