From b8fc9cae4d68e6b203b1b846ac657698e7d7f979 Mon Sep 17 00:00:00 2001 From: Jake Palmer Date: Wed, 26 Aug 2020 10:51:37 +1000 Subject: [PATCH] Check if required inputs exist in pipeline.sh --- src/pipeline.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) mode change 100644 => 100755 src/pipeline.sh diff --git a/src/pipeline.sh b/src/pipeline.sh old mode 100644 new mode 100755 index edb46f1..2540561 --- a/src/pipeline.sh +++ b/src/pipeline.sh @@ -19,6 +19,21 @@ export PATH=$PATH:$ANTSPATH:/extra/ANTS/ANTs/Scripts # Set up pytorch source /extra/pytorch/bin/activate +# Check input +if [[ ! -f /INPUTS/b0.nii.gz ]]; then + echo ERROR: Could not find required input /INPUTS/b0.nii.gz + exit +elif [[ ! -f /INPUTS/T1.nii.gz ]]; then + echo ERROR: Could not find required input /INPUTS/T1.nii.gz + exit +elif [[ ! -f /INPUTS/acqparams.txt ]]; then + echo ERROR: Could not find required input /INPUTS/acqparams.txt + exit +elif [[ ! -f /extra/freesurfer/license.txt ]]; then + echo ERROR: Could not find required /extra/freesurfer/license.txt + exit +fi + # Prepare input prepare_input.sh /INPUTS/b0.nii.gz /INPUTS/T1.nii.gz /extra/atlases/mni_icbm152_t1_tal_nlin_asym_09c.nii.gz /extra/atlases/mni_icbm152_t1_tal_nlin_asym_09c_2_5.nii.gz /OUTPUTS