forked from FernandoPalazuelos/Displasias
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnii2streams_brkraw_analysis.sh
executable file
·70 lines (54 loc) · 1.16 KB
/
nii2streams_brkraw_analysis.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
#!/bin/bash
source `which my_do_cmd`
help(){
echo "
How to use:
`basename $0` <lines.nii.gz> <image.nii.gz> <outfolder> <prefix>
LU15 (0N(H4
INB UNAM
Jan 2022
"
}
if [ $# -lt 4 ]
then
echolor red "Not enough arguments"
help
exit 2
fi
lines=$1
t2=$2
outfolder=$3
prefix=$4
if [ ! -d $outfolder ]
then
echolor red "ERROR Output directory does not exist: $outfolder"
exit 2
fi
# prepare orientation and separate slices
nii2streams_prepareOrientation.sh $lines $t2 $outfolder
for ss in `ls -d $outfolder/??`
do
slice=`basename $ss`
echolor yellow "Working on slice $slice"
sides="l r"
for side in $sides
do
my_do_cmd nii2streams.sh \
${outfolder}/${slice}/${side}_inline.nii.gz \
${outfolder}/${slice}/${side}_outline.nii.gz \
${outfolder}/image.nii.gz \
${outfolder}/${slice} \
$side \
$prefix
done
done
# now put streamlines in native space
for streamlinetck in ${outfolder}/*/tck/*.tck
do
#echolor green "working on $streamlinetck"
streamlinetck_native=${streamlinetck%.tck}_native.tck
tck_permute_axes.sh \
-r $lines \
$streamlinetck $streamlinetck_native
done