-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path7_LayerData.sh
84 lines (69 loc) · 3.25 KB
/
7_LayerData.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
82
#!/bin/bash
upsample_rT1_path='upsample_rT1.nii'
upsample_meanMT_ON_path='upsample_meanMT_ON.nii'
upsample_MT_ON_beta_path='upsample_1_STATS_rMT_ON.nii'
upsample_MT_ON_t_path='upsample_2_STATS_rMT_ON.nii'
upsample_meanMT_OFF_path='upsample_meanMT_OFF.nii'
upsample_MT_OFF_beta_path='upsample_1_STATS_rMT_OFF.nii'
upsample_MT_OFF_t_path='upsample_2_STATS_rMT_OFF.nii'
# Edit:
rim_layers_path='rim_VR19_layers.nii'
# output file
layer_MT_ON_t_path='VR19_layer_MT_ON_t.dat'
layer_MT_OFF_t_path='VR19_layer_MT_OFF_t.dat'
layer_MT_ON_beta_path='VR19_layer_MT_ON_beta.dat'
layer_MT_OFF_beta_path='VR19_layer_MT_OFF_beta.dat'
#extractiong profiles for MT ON t
#get mean value, STDEV, and number of voxels
3dROIstats -mask ${rim_layers_path} -1DRformat -quiet -nzmean ${upsample_MT_ON_t_path} > layer_tem.dat
3dROIstats -mask ${rim_layers_path} -1DRformat -quiet -sigma ${upsample_MT_ON_t_path} >> layer_tem.dat
3dROIstats -mask ${rim_layers_path} -1DRformat -quiet -nzvoxels ${upsample_MT_ON_t_path} >> layer_tem.dat
#format file to be in columns, so gnuplot can read it.
WRD=$(head -n 1 layer_tem.dat|wc -w);
for((i=2;i<=$WRD;i=i+2)); do
awk '{print $'$i'}' layer_tem.dat| tr '\n' ' ';
echo;
done > layer.dat
1dplot -sepscl layer.dat
mv layer.dat ${layer_MT_ON_t_path}
#extractiong profiles for MT OFF t
#get mean value, STDEV, and number of voxels
3dROIstats -mask ${rim_layers_path} -1DRformat -quiet -nzmean ${upsample_MT_OFF_t_path} > layer_tem.dat
3dROIstats -mask ${rim_layers_path} -1DRformat -quiet -sigma ${upsample_MT_OFF_t_path} >> layer_tem.dat
3dROIstats -mask ${rim_layers_path} -1DRformat -quiet -nzvoxels ${upsample_MT_OFF_t_path} >> layer_tem.dat
#format file to be in columns, so gnuplot can read it.
WRD=$(head -n 1 layer_tem.dat|wc -w);
for((i=2;i<=$WRD;i=i+2)); do
awk '{print $'$i'}' layer_tem.dat| tr '\n' ' ';
echo;
done > layer.dat
1dplot -sepscl layer.dat
mv layer.dat ${layer_MT_OFF_t_path}
#extractiong profiles for MT ON beta
#get mean value, STDEV, and number of voxels
3dROIstats -mask ${rim_layers_path} -1DRformat -quiet -nzmean ${upsample_MT_ON_beta_path} > layer_tem.dat
3dROIstats -mask ${rim_layers_path} -1DRformat -quiet -sigma ${upsample_MT_ON_beta_path} >> layer_tem.dat
3dROIstats -mask ${rim_layers_path} -1DRformat -quiet -nzvoxels ${upsample_MT_ON_beta_path} >> layer_tem.dat
#format file to be in columns, so gnuplot can read it.
WRD=$(head -n 1 layer_tem.dat|wc -w);
for((i=2;i<=$WRD;i=i+2)); do
awk '{print $'$i'}' layer_tem.dat| tr '\n' ' ';
echo;
done > layer.dat
1dplot -sepscl layer.dat
mv layer.dat ${layer_MT_ON_beta_path}
#extractiong profiles for MT OFF beta
#get mean value, STDEV, and number of voxels
3dROIstats -mask ${rim_layers_path} -1DRformat -quiet -nzmean ${upsample_MT_OFF_beta_path} > layer_tem.dat
3dROIstats -mask ${rim_layers_path} -1DRformat -quiet -sigma ${upsample_MT_OFF_beta_path} >> layer_tem.dat
3dROIstats -mask ${rim_layers_path} -1DRformat -quiet -nzvoxels ${upsample_MT_OFF_beta_path} >> layer_tem.dat
#format file to be in columns, so gnuplot can read it.
WRD=$(head -n 1 layer_tem.dat|wc -w);
for((i=2;i<=$WRD;i=i+2)); do
awk '{print $'$i'}' layer_tem.dat| tr '\n' ' ';
echo;
done > layer.dat
1dplot -sepscl layer.dat
mv layer.dat ${layer_MT_OFF_beta_path}
#gnuplot "gnuplot_layers_t.txt"
#gnuplot "gnuplot_layers_beta.txt"