-
Notifications
You must be signed in to change notification settings - Fork 0
/
slurm_proc_7T_ashs.sh
67 lines (52 loc) · 2.13 KB
/
slurm_proc_7T_ashs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
#slurm_process_pipeline.sh
while getopts :p:s:z:m:f:l:b:t: option; do
case ${option} in
p) export CLEANPROJECT=$OPTARG ;;
s) export CLEANSESSION=$OPTARG ;;
z) export CLEANSUBJECT=$OPTARG ;;
m) export MINQC=$OPTARG ;;
f) export fieldmaps=$OPTARG ;;
l) export longitudinal=$OPTARG ;;
b) export based=$OPTARG ;;
t) export version=$OPTARG ;;
esac
done
## takes project, subject, and session as inputs
pilotdir=${based}/original_location_of_images_from_XNAT
IMAGEDIR=${based}/singularity_images
tmpdir=${based}/${version}/testing
scripts=${based}/${version}/scripts
bids_out=${based}/${version}/bids_only
conn_out=${based}/${version}/conn_out
dataqc=${based}/${version}/data_qc
stmpdir=${based}/${version}/scratch/stmp
scachedir=${based}/${version}/scratch/scache
cd $pilotdir
DIR=${CLEANPROJECT}/${CLEANSUBJECT}/${CLEANSESSION}
## setup our variables and change to the session directory
echo ${CLEANPROJECT}
echo ${CLEANSUBJECT}
echo ${CLEANSESSION}
pwd
#translating naming conventions
echo "${CLEANSESSION: -1}"
session="${CLEANSESSION: -1}"
echo ${session}
project=${CLEANPROJECT}
mkdir -p ${tmpdir}/${project}/${CLEANSUBJECT}/${session}
cp -R ${pilotdir}/${DIR} ${tmpdir}/${project}/${CLEANSUBJECT}/${session}
subject="sub-"${CLEANSUBJECT}
sesname="ses-"${session}
projDir=${tmpdir}/${project}
scripts=${based}/${version}/scripts
cd $projDir
IMAGEDIR=${based}/singularity_images
CACHESING=${scachedir}/${project}_${subject}_${sesname}_dcm2rsfc
TMPSING=${stmpdir}/${project}_${subject}_${sesname}_dcm2rsfc
mkdir $CACHESING
mkdir $TMPSING
ses=${sesname:4}
sub=${subject:4}
export SINGULARITYENV_ASHS_ROOT=/opt/ashs/ashs-1.0.0
SINGULARITY_CACHEDIR=$CACHESING SINGULARITY_TMPDIR=$TMPSING singularity exec --cleanenv --bind ${projDir}:/datain $IMAGEDIR/ashs-1.0.0.sif $SINGULARITYENV_ASHS_ROOT/bin/ashs_main.sh -a /opt/ashs/ashs_atlas_umcutrecht_7t_20170810 -g /datain/bids/${subject}/${sesname}/anat/${subject}_${sesname}_acq-mp2rageunidenoised_T1w.nii.gz -f /datain/bids/${subject}/${sesname}/anat/${subject}_${sesname}_acq-highreshippocampus_run-1_T2w.nii.gz -w /datain/bids/derivatives/ashs/${subject}/${sesname}