forked from FernandoPalazuelos/Displasias
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisplasia_tckfixelsample_CSD.sh
executable file
·67 lines (46 loc) · 1.39 KB
/
displasia_tckfixelsample_CSD.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
#!/bin/bash
source `which my_do_cmd`
module load matlab
# this is a wrapper for the matlab function,
# but it prepares the fixels in volume format.
Inputs=""
while getopts "t:f:p:" flag
do
case "${flag}" in
t) tck=${OPTARG};;
f) fixels_dir=${OPTARG};;
p) prefix=${OPTARG};;
esac
done
#mInputs=`echo $Inputs | sed 's/ /,/g'`
# prepare fixels as volumes
fixels_afd=${fixels_dir}/afd.mif
if [ ! -f $fixels_afd ]
then
echolor red "[ERROR] Cannot find file: $fixels_afd"
fi
nComp=${fixels_dir}/afd_count.nii
afd_as_volume=${fixels_dir}/afd_as_volume.nii
peaks_as_volume=${fixels_dir}/peaks_as_volume.nii
fixel2voxel $fixels_afd count $nComp
fixel2voxel $fixels_afd none $afd_as_volume
fixel2peaks $fixels_dir $peaks_as_volume
mInputs="${afd_as_volume}"
matlabjobfile=$(mktemp -t).m
####################### matlab job
echo "
addpath('/home/inb/soporte/lanirem_software/mrtrix_3.0.4/matlab/')
addpath(genpath('/misc/lauterbur/lconcha/code/geom3d'))
addpath('/misc/mansfield/lconcha/software/Displasias');
f_tck = '$tck';
f_PDD = '$peaks_as_volume';
f_ncomp = '$nComp';
ff_values = {'${mInputs}'};
f_prefix = '$prefix';
VALUES = displasia_tckfixelsample_CSD(f_tck, f_PDD, f_ncomp, ff_values, f_prefix);
exit
" > $matlabjobfile
###################### end of matlab job
cat $matlabjobfile
matlab -nodisplay -nosplash <$matlabjobfile
rm $matlabjobfile