-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviz_helix_space_wrapper.m
173 lines (141 loc) · 4.96 KB
/
viz_helix_space_wrapper.m
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
function [DM_array,SOAM_array,SOTM_array,LL_array,K_array] = viz_helix_space_wrapper(sample_rate)
%%Wrapper to do_sine.m intended to make a 2/3D plots of values
%%retrieved from measure tortuosity given a sample rate.
%%
%Intializing.
min_amp = 3;
max_amp = 20;
iter_amp = 1;
min_freq = 1;
max_freq = 10;
iter_freq = 1;
%%
%Readying loops
amps = min_amp:iter_amp:max_amp;
freqs = min_freq:iter_freq:max_freq;
length_amps = length(amps);
length_freqs = length(freqs);
DM_array = zeros(length_amps,length_freqs);
SOAM_array = zeros(length_amps,length_freqs);
SOTM_array = zeros(length_amps,length_freqs);
LL_array = zeros(length_amps,length_freqs);
K_array = zeros(length_amps,length_freqs);
%%
%Looping
disp(['Starting ' num2str(length_amps*length_freqs) ' iterations...'])
parfor i=1:length_amps
%Outer loop
this_amp = amps(i);
for j=1:length_freqs
%Inner loop
this_freq = freqs(j); %#ok<PFBNS>
disp(['Current A: ' num2str(this_amp)])
disp(['Current F: ' num2str(this_freq)])
[this_DM,this_SOAM,this_SOTM,this_LL,this_K,this_K_theo] = do_helix(this_freq,this_amp);
%Storing
DM_array(i,j) = this_DM;
SOAM_array(i,j) = this_SOAM;
SOTM_array(i,j) = this_SOTM;
LL_array(i,j) = this_LL;
K_array(i,j) = this_K;
end
end
figure(1)
bar3(DM_array)
title('[Helix] DM plot')
axis([0 Inf 0 Inf 1 max(DM_array(:))])
xlabel('Frequencies')
ylabel('Amplitudes')
figure(2)
bar3(SOAM_array)
title('[Helix] SOAM plot')
axis([0 Inf 0 Inf 0 max(SOAM_array(:))])
xlabel('Frequencies')
ylabel('Amplitudes')
SOAM_array_mod = SOAM_array;
isnan_SOAM_index = (SOAM_array == -1);
SOAM_array_mod(isnan_SOAM_index) = NaN;
mean_SOAM_array = nanmean(SOAM_array_mod);
figure(3)
bar(mean_SOAM_array)
title('[Helix] (NaN)Mean (per freq) SOAM plot')
xlabel('Frequencies')
ylabel('Amplitudes')
LL_array_mod = LL_array;
isnan_LL_index = (LL_array == -1);
LL_array_mod(isnan_LL_index) = NaN;
figure(4)
bar3(LL_array_mod)
title('[Helix] Arc length plot')
axis([0 Inf 0 Inf min(LL_array_mod(:)) max(LL_array_mod(:))])
xlabel('Frequencies')
ylabel('Amplitudes')
size_DM = size(DM_array);
col_coding_amp = repmat(1:size_DM(1),1,size_DM(2));
col_coding_amp = col_coding_amp/max(col_coding_amp);
col_coding_amp = [col_coding_amp' 1-col_coding_amp' col_coding_amp'];
figure(5)
scatter(DM_array(:),SOAM_array(:),10,col_coding_amp,'filled')
axis([1 Inf 0 Inf])
xlabel('DM')
ylabel('SOAM')
title('[Helix] DM vs SOAM scatterplot [Amp coded]')
col_coding_freq = repmat((1:size_DM(2))',size_DM(1),1);
col_coding_freq = col_coding_freq/max(col_coding_freq);
col_coding_freq = [col_coding_freq 1-col_coding_freq col_coding_freq];
figure(6)
scatter(DM_array(:),SOAM_array(:),10,col_coding_freq,'filled')
axis([1 Inf 0 Inf])
xlabel('DM')
ylabel('SOAM')
title('[Helix] DM vs SOAM scatterplot [Freq coded]')
figure(7)
bar3(K_array)
title('[Helix] Finite Difference K curvature')
axis([0 Inf 0 Inf 0 max(K_array(:))])
xlabel('Frequencies')
ylabel('Amplitudes')
figure(8)
scatter(K_array(:),SOAM_array(:),10,col_coding_amp,'filled')
axis([0 Inf 0 Inf])
xlabel('Finite Difference K curvature')
ylabel('SOAM')
title('[Helix] Finite Difference K curvature vs SOAM scatterplot [Amp coded]')
figure(9)
scatter(DM_array(:),K_array(:),10,col_coding_amp,'filled')
axis([1 Inf 0 Inf])
xlabel('DM')
ylabel('Finite Difference K curvature')
title('[Helix] DM vs Finite Difference K curvature scatterplot [Amp coded]')
figure(10)
bar3(SOTM_array)
title('[Helix] SOTM plot')
axis([0 Inf 0 Inf 0 max(SOTM_array(:))])
xlabel('Frequencies')
ylabel('Amplitudes')
figure(11)
scatter(DM_array(:),SOTM_array(:),10,col_coding_amp,'filled')
axis([1 Inf 0 Inf])
xlabel('DM')
ylabel('SOTM')
title('[Helix] DM vs SOTM scatterplot [Amp coded]')
figure(12)
scatter(SOTM_array(:),SOAM_array(:),10,col_coding_amp,'filled')
axis([0 Inf 0 Inf])
xlabel('SOTM')
ylabel('SOAM')
title('[Helix] SOTM vs SOAM scatterplot [Amp coded]')
figure(13)
scatter(K_array(:),SOTM_array(:),10,col_coding_amp,'filled')
axis([0 Inf 0 Inf])
xlabel('Finite Difference K curvature')
ylabel('SOTM')
title('[Helix] Finite Difference K curvature vs SOTM scatterplot [Amp coded]')
figure(14)
plot3(DM_array(:),SOAM_array(:),SOTM_array(:),'*','Color','b')
axis([1 Inf 0 Inf 0 Inf])
xlabel('DM')
ylabel('SOAM')
zlabel('SOTM')
title('[Helix] DM vs SOAM vs SOTM')
end