-
Notifications
You must be signed in to change notification settings - Fork 0
/
MRIQC.sh
79 lines (66 loc) · 1.93 KB
/
MRIQC.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
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
## 7T049 CVI/Visual Brain Study
#
usage()
{
base=$(basename "$0")
echo "usage: $base sID [options]
Conversion of DCMs in /sourcedata into NIfTIs in /rawdata
1. Deface (not implemented)
2. Run of MRIQC on structural data
3. Run of fMRIPrep (not implemented)
Arguments:
sID Subject ID (e.g. 107)
Options:
-h / -help / --help Print usage.
"
exit;
}
################ ARGUMENTS ################
[ $# -ge 1 ] || { usage; }
command=$@
sID=$1
shift
while [ $# -gt 0 ]; do
case "$1" in
-h|-help|--help) usage; ;;
-*) echo "$0: Unrecognized option $1" >&2; usage; ;;
*) break ;;
esac
shift
done
# Define Folders
codedir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
studydir=`pwd` #studydir=`dirname -- "$codedir"`
rawdatadir=$studydir/rawdata;
sourcedatadir=$studydir/sourcedata;
scriptname=`basename $0 .sh`
logdir=$studydir/derivatives/logs/sub-${sID}
if [ ! -d $rawdatadir ]; then mkdir -p $rawdatadir; fi
if [ ! -d $logdir ]; then mkdir -p $logdir; fi
# We place a .bidsignore here
if [ ! -f $rawdatadir/.bidsignore ]; then
echo -e "# Exclude following from BIDS-validator\n" > $rawdatadir/.bidsignore;
fi
# we'll be running the Docker containers as yourself, not as root:
userID=$(id -u):$(id -g)
### Get docker images: ###
docker pull poldracklab/mriqc:latest
################ PROCESSING ################
### MRIQC: ###
# mriqc_reports folder contains the reports generated by 'mriqc'
# participant level
docker run --name mriqc_container \
--user $userID \
--rm \
--volume $studydir:/data \
poldracklab/mriqc \
/data \
/data/derivatives/mriqc_reports \
participant \
--ica \
--verbose-reports \
--fft-spikes-detector \
--participant_label ${sID} \
> $logdir/sub-${sID}_mriqc_participant.log 2>&1
# FL - Add group level?