-
Notifications
You must be signed in to change notification settings - Fork 1
/
main
executable file
·46 lines (36 loc) · 1.37 KB
/
main
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
#!/bin/bash
#PBS -l nodes=1:ppn=4,walltime=6:00:00,vmem=30g
#PBS -N app-mriqc
rm -rf output
set -e
set -x
VERSION=22.0.6
# identify datatype
TYPE=`jq -r '.type' config.json`
if [[ $(jq -r '.input' config.json) == *"t1"* ]]; then
modality="T1w"
elif [[ $(jq -r '.input' config.json) == *"t2"* ]]; then
modality="T2w"
elif [[ $(jq -r '.input' config.json) == *"bold"* ]]; then
modality="bold"
fi
#copy input under input in bids format
mkdir -p input/sub-0/${TYPE} output regressors subject_html group_html subject_html/html group_html/html
ln -sf ../../../$(jq -r '.input' config.json) input/sub-0/${TYPE}/sub-0_${modality}.nii.gz
cat > input/dataset_description.json <<EOF
{
"BIDSVersion": "1.0.0",
"Name": "Temp dataset",
"Authors": [
"Soichi Hayashi"
]
}
EOF
# run mriqc
time singularity exec docker://nipreps/mriqc:${VERSION} mriqc input output participant --no-sub
# generate regressors tsv
time singularity exec -e docker://brainlife/dipy:1.4.1 ./create_regressors_table.py
# copy files to appropriate outputs
[ -f ./output/sub-0/${TYPE}/subj-0_*.json ] && cp ./output/sub-0/${TYPE}/subj-0_*.json ./product.json
[ -f ./output/group_${modality}.html ] && cp ./output/group_${modality}.html ./group_html/html/group_${modality}.html
[ -f ./output/sub-0_${modality}.html ] && cp ./output/sub-0_${modality}.html ./subject_html/html/sub-0_${modality}.html