forked from FernandoPalazuelos/Displasias
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisplasia_batch_streamlines.sh
executable file
·61 lines (56 loc) · 2.16 KB
/
displasia_batch_streamlines.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
#!/bin/bash
source `which my_do_cmd`
fakeflag=""
imagesdir=/misc/nyquist/lconcha/displasia
for grp in CTRL BCNU
do
for dr in ${imagesdir}/${grp}/*
do
rat=$(basename $dr)
for dd in ${imagesdir}/${grp}/${rat}/*
do
day=$(basename $dd)
echolor cyan "[INFO] Working on $grp $rat $day"
# echolor yellow "[INFO] Streamlines on T2 space"
# testfile=$(ls ${imagesdir}/${grp}/${rat}/${day}/derivatives/anat/??/tck/anat_?_seeds_smooth_resampled_imagespace_native.tck 2>/dev/null | tail -n 1)
# if [ ! -z "$testfile" -a -f $testfile ]
# then
# echolor green "[INFO] Anat Streamlines already exist. Found $testfile"
# else
# echolor yellow "[INFO] Running streamlines on T2 space"
# lines=${imagesdir}/${grp}/${rat}/${day}/anat/lines.nii.gz
# t2=${imagesdir}/${grp}/${rat}/${day}/anat/T2_regrid.nii.gz
# outfolder=${imagesdir}/${grp}/${rat}/${day}/derivatives/anat
# mkdir -p $outfolder
# my_do_cmd $fakeflag fsl_sub -N anat_${rat}-${day} \
# -l /misc/nyquist/lconcha/logs \
# -s smp,4 \
# nii2streams_brkraw_analysis.sh \
# $lines \
# $t2 \
# $outfolder \
# anat
# fi
echolor yellow "[INFO] Streamlines on DWI space"
testfile=$(ls ${imagesdir}/${grp}/${rat}/${day}/derivatives/dwi/??/tck/dwi_?_seeds_smooth_resampled_imagespace_native.tck 2>/dev/null | tail -n 1)
if [ ! -z "$testfile" -a -f $testfile ]
then
echolor green "[INFO] DWI Streamlines already exist. Found $testfile"
else
echolor yellow "[INFO] Running streamlines on DWI space"
lines=${imagesdir}/${grp}/${rat}/${day}/dwi/lines.nii.gz
dwi=${imagesdir}/${grp}/${rat}/${day}/dwi/dwi_hibval_deb.nii.gz
outfolder=${imagesdir}/${grp}/${rat}/${day}/derivatives/dwi
mkdir -p $outfolder
my_do_cmd $fakeflag fsl_sub -N dwi_${rat}-${day} \
-l /misc/nyquist/lconcha/logs \
-s smp,4 \
nii2streams_brkraw_analysis.sh \
$lines \
$lines \
$outfolder \
dwi
fi
done
done
done