-
Notifications
You must be signed in to change notification settings - Fork 0
/
fmriprep-all.sh
51 lines (44 loc) · 1.13 KB
/
fmriprep-all.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
#!/usr/bin/env bash
# User inputs:
# sub='01 06 11 16'
# ds_name=auditory_vs_visual
# ds_nr=ds003717
sub=$1
ds_name=$2
ds_nr=$3
# Datapaths
rawdata_dir="/LOCAL/jzerbe/$ds_name/$ds_nr"
derivatives_dir="/LOCAL/jzerbe/$ds_name/$ds_nr/derivatives/fmriprep"
license_dir="/home/jzerbe/freesurfer.txt"
working_dir="/LOCAL/jzerbe/temp_working_dir_$ds_name"
memory=100000
cpus='30'
STARTTIME=$(date +%s)
# Loop through subjects string
for val in $sub; do
if [ ! -d $working_dir ]
then
mkdir $working_dir
fi
if [ ! -d $derivatives_dir ]
then
mkdir $derivatives_dir
fi
# Run fmriprep:
fmriprep-docker $rawdata_dir $derivatives_dir \
participant \
--participant-label $val \
--skip-bids-validation \
--fs-license-file $license_dir \
--output-spaces T1w MNI152NLin2009cAsym MNI152NLin6Asym \
--user 1022:1023 \
--use-aroma \
--error-on-aroma-warnings \
--mem-mb $memory \
--n_cpus $cpus \
--work-dir $working_dir;
rm -rf $working_dir;
done
#rm -rf $working_dir;
ENDTIME=$(date +%s)
echo "Duration in seconds: $(($ENDTIME - $STARTTIME))"