-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun
83 lines (56 loc) · 1.77 KB
/
run
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
80
81
82
83
#! /bin/bash
#
#
CONTAINER="[scitran/afq_pipeline]"
echo -e "$CONTAINER Initiated"
###############################################################################
# Built to flywheel-v0 spec.
FLYWHEEL_BASE=/flywheel/v0
OUTPUT_DIR=$FLYWHEEL_BASE/output
INPUT_DIR=$FLYWHEEL_BASE/input
################################################################################
# CONFIGURE ENV
source ${FLYWHEEL_BASE}/docker-env.sh
################################################################################
# Use the SDK to download the data
${FLYWHEEL_BASE}/fw_sdk_getData.py
exit_status=$?
if [[ $exit_status != 0 ]]; then
echo "$CONTAINER Failure during FW SDK download. Exiting!"
exit $exit_status
fi
###############################################################################
# Built to flywheel-v0 spec.
${FLYWHEEL_BASE}/run_fslmerge
exit_status=$?
if [[ $exit_status != 0 ]]; then
echo "$CONTAINER MERGE failure!"
exit $exit_status
fi
###############################################################################
# DTIINIT
# Make DTI_INIT DIRECTORIES
NIFTI_DIR=$INPUT_DIR/dwi
BVEC_DIR=$INPUT_DIR/bvec
BVAL_DIR=$INPUT_DIR/bval
mkdir "$NIFTI_DIR" && cp "$OUTPUT_DIR"/*.nii* "$NIFTI_DIR"
mkdir "$BVEC_DIR" && cp "$OUTPUT_DIR"/*.bvec* "$BVEC_DIR"
mkdir "$BVAL_DIR" && cp "$OUTPUT_DIR"/*.bval* "$BVAL_DIR"
${FLYWHEEL_BASE}/run_dtiinit
exit_status=$?
if [[ $exit_status != 0 ]]; then
echo "$CONTAINER DTIINIT failure!"
exit $exit_status
fi
###############################################################################
# AFQ
# Make AFQ DIRECTORY
ZIP_DIR=$INPUT_DIR/dtiInit_Archive
mkdir "$ZIP_DIR" && cp "$OUTPUT_DIR"/*.zip "$ZIP_DIR"
${FLYWHEEL_BASE}/run_afq
exit_status=$?
if [[ $exit_status != 0 ]]; then
echo "$CONTAINER AFQ failure!"
exit $exit_status
fi
exit 0