-
Notifications
You must be signed in to change notification settings - Fork 7
/
subject_tractography.sh
81 lines (65 loc) · 1.84 KB
/
subject_tractography.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
80
81
#!/bin/bash -v
#SBATCH --cpus-per-task=8
#SBATCH --mem-per-cpu=2048
#SBATCH --partition=main
#SBATCH --time=12:00:00
################################################################################
#
# subject_tractography
# --------------------
#
# A batch to construct a tractogram for a HCP subject
#
################################################################################
#
# Usage : subject_tractography.sh <subject_number>
# (Should be ran in the home directory of the subect subdirectories.
# Subject subdirectory should include at least these files:
# 1) wmfod_norm.mif
# 2) 5TT.mif
#
# Output : Tractogram for the subject
# 1) tracks.tck - the tractogram file
# 2) seeds.txt - the seeds used for tractography
# 3) tckgen_log.txt - log file
#
# Note : mrtrix-gcc module should be available
#
# Author : Oren Civier
# Version: 1.01
# Date : 19/10/2017
#
################################################################################
echo "========================================"
echo "Tractogram reconstruction"
echo "========================================"
echo "start time"
date
echo
echo "temp dir is"
echo $TMPDIR
echo
find . -name tracks.tck
find . -name track_weights.txt
module load mrtrix-gcc
n=$1
echo "subject: ${n}"
act_5tt=${n}/5TT.mif
seed_wm=${n}/seed_wm.nii.gz
fod=${n}/wmfod_norm.mif
#### do tracking (specify -number to set the desired track count)
tckgen \
-force \
-algorithm iFOD2 \
-select 10000000 \
-cutoff 0.06 \
-minlength 5.0 \
-maxlength 300.0 \
-act ${act_5tt} -backtrack -crop_at_gmwmi \
-max_attempts_per_seed 1000 \
-seed_dynamic ${fod} \
-output_seeds ${n}/seeds.txt \
${fod} ${n}/tracks.tck |& tee ${n}/tckgen_log.txt
echo "end time"
date
echo