forked from tfunck/minc_keras
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wId_newData.sh
40 lines (31 loc) · 1.79 KB
/
wId_newData.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
angle=8;
for view in {X,Y,Z};do \
if [ $view == "X" ];then param2xfm -rotation $angle 0 0 rot${view}pos${angle}.xfm;param2xfm -rotation -$angle 0 0 rot${view}neg${angle}.xfm;
elif [ $view == "Y" ];then param2xfm -rotation 0 $angle 0 rot${view}pos${angle}.xfm;param2xfm -rotation 0 -$angle 0 rot${view}neg${angle}.xfm;
else param2xfm -rotation 0 0 $angle rot${view}pos${angle}.xfm;param2xfm -rotation 0 0 -$angle rot${view}neg${angle}.xfm;
fi;done
for ii in data/sub-*/*_acq-*;do \
id=`dirname $ii|rev|cut -d/ -f1|rev|cut -c5-`;
echo $id;
mincaverage $ii `echo $ii|cut -d. -f1`_sum.mnc -avgdim time -width_weighted;
for vv in rot*;do \
mincresample `echo $ii|cut -d. -f1`_sum.mnc data_new/sub_${id}_task-`echo ${vv}|cut -d. -f1`_`basename $ii|cut -d_ -f2`.mnc -transformation $vv -like `echo $ii|cut -d. -f1`_sum.mnc -nearest_neighbour -clobber;
done;
done;
for ii in data/sub-*/*labels.mnc;do \
id=`dirname $ii|rev|cut -d/ -f1|rev|cut -c5-`;
echo $id;
for vv in rot*;do \
mincresample $ii data_new/sub_${id}_labels-`echo ${vv}|cut -d. -f1`.mnc -transformation $vv -like $ii -nearest_neighbour -clobber;
done;
done;
for ii in data/sub-*/*labels_brainmask.mnc;do \
id=`dirname $ii|rev|cut -d/ -f1|rev|cut -c5-`;
echo $id;
for vv in rot*;do \
mincresample $ii data_new/sub_${id}_labels-`echo ${vv}|cut -d. -f1`_`basename $ii|cut -d_ -f3` -transformation $vv -like $ii -nearest_neighbour -clobber;
done;
done;
for ii in data/sub-*/*sum.mnc;do id=`dirname $ii|cut -d/ -f2|cut -c5-`;cp $ii data_new/sub_${id}_task-rot0_`basename $ii|cut -d_ -f2`.mnc;done
for ii in data/sub-*/*labels.mnc;do id=`dirname $ii|cut -d/ -f2|cut -c5-`;cp $ii data_new/sub_${id}_labels-rot0.mnc;done
for ii in data/sub-*/*labels_brainmask.mnc;do id=`dirname $ii|cut -d/ -f2|cut -c5-`;cp $ii data_new/sub_${id}_labels-rot0_`basename $ii|cut -d_ -f3`;done